May-31-2020, 06:02 PM
Hello.
I have a lot of tests and run with pytest. Some code (in product, not in tests) perform operations like
I have a lot of tests and run with pytest. Some code (in product, not in tests) perform operations like
os.chdir(some_dir)
, thus tests which are looking for some testdata always fail after that if I run all tests. And these tests always work if run them separately. So, the question is - how to return back to root directory for each test? Probably, it should be a fixture, but how to determine root directory? Setup some variable during the first run?