Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to found tests: no tests ran #127

Open
GreGGus opened this issue Feb 17, 2025 · 3 comments
Open

Impossible to found tests: no tests ran #127

GreGGus opened this issue Feb 17, 2025 · 3 comments

Comments

@GreGGus
Copy link

GreGGus commented Feb 17, 2025

Hey.

I'm using Jupyter Notebook on VSCode, in order to test some transformations on Databricks (using db-connect).

No idea why, but after a lot of time, i'm not able to run any tests.

I did run everything, but each time i got:

no tests ran in 0.00s.

Even with Example notebooks.

What am i doing wrong ?

Image

Thanks

@chmp
Copy link
Owner

chmp commented Feb 17, 2025

If I remember correctly, #50, #47, databricks is using their own setup for notebooks. I think, ipytest never quite worked with databricks.

If you run import __main__; print(sorted(vars(__main__))), do you see the test functions?

@GreGGus
Copy link
Author

GreGGus commented Feb 17, 2025

Forget about Databricks (or not apparently), I'm not using their notebooks.
I'm just trying to setup your example, and then I'll connect it to Databricks (and it should work tbh).

I'll share with you if I'm able to make it work. (think a lot of user are interested about that) (I'm using Databricks-Connect to let Spark read Data from Databricks). Works perfectly with pytest and normal python file.
Works perfectly with my .ipynb (I'm able to connect to DBX), but tests are not working.

Let's get back to your example:

Image

I'm using 100% .ipynb file, download directly from your repo.

No idea what I missed here.

Thanks you so much for you help.

VSCode on MAC

This is the results of your import __main__; print(sorted(vars(__main__))),

['@py_builtins', '@pytest_ar', 'Any', 'In', 'List', 'Magics', 'Out', 'Union', '_', '__', '___', '__builtin__', '__builtins__', '__doc__', '__loader__', '__main__', '__name__', '__package__', '__spec__', '__vsc_ipynb_file__', '_dh', '_exit_code', '_i', '_i1', '_i2', '_i3', '_i4', '_ih', '_ii', '_iii', '_oh', 'builtinSum', 'cfg', 'contextmanager', 'convert_databricks_notebook_to_ipynb', 'databricks_notebook_exec_env', 'dbutils', 'display', 'displayHTML', 'exit', 'functools', 'getArgument', 'get_ipython', 'ipytest', 'is_databricks_notebook', 'json', 'line_magic', 'logError', 'logErrorAndContinue', 'magics_class', 'my_func', 'needs_local_scope', 'open', 'os', 'quit', 'shlex', 'show_progress', 'spark', 'sql', 'strip_hash_magic', 'sys', 'tempfile', 'test_my_func', 'time', 'udf', 'warnings']

@chmp
Copy link
Owner

chmp commented Feb 19, 2025

Hm. Strange. TBH. I have no idea what's happening. I just verified that ipytest works in VSCode without issue. Can you check what kernel you are running? (import sys; print(sys.argv) What ipytest version have you installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants