I have a directory with a bunch of modules. Each module has a bunch of specific tests.
I know how to
teardown after methods, classes and modules. What am trying to do is
teardown after all the tests in all the modules in the directory are done running.
My directory structure looks something like this:
I created this fixture in the
@pytest.yield_fixture(scope="package") def **clean_cookie_file**(): Path.unlink(filename)
Implementation of the
fixture looks like this:
@pytest.mark.usefixtures("class_fixture", "**clean_cookie_file**") class foo(unittest.TestCase):
Expected Result: file deleted
Actual Result: file not deleted
Any help will be much appreciated.