I have a requirement in my project, where we will be writing some python code inside databricks . Please note we will not be using pyspark . It will plain pythin with polars.
I am looking into ho to create test files for main file. Below is simple example which i am trying
Inside repo - i created a file called function_file.py. I wrote a simple function
Hi @sudhanshu1 , The error you're encountering is due to the fact that pytest is looking for a fixture named 'name' which is not defined.
Fixtures in pytest are functions that are run before each test function to which it is applied. Fixtures are used to feed some data to the tests such as database connections, URLs to test and some sort of input data.
Therefore, pytest is looking for a fixture 'name' to use with your test function
In your case, you're not using any fixture, so the error seems to be a misunderstanding. If you're not intending to use a fixture, then the test function
test_name() should not have any fixture named 'name'.
To resolve this issue, ensure that your test function does not require any fixture or if it does, make sure the fixture is defined.
Thanks Kaniz or your answer. However I think i am struggling to understand some basics.
Currently i just wrote a simple test function.
This test passes , but when i make any small change in this function ,it doesnt reflect .
Example i change assert to 1==0, but my output is still same.
How to refresh main notebook which i am using to run tests files to pick latest change from tests files please? One solution is to restart cluster every time , but that's very bad solution
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!