My problem is this I have a project of multiple tests all sitting under a root folder Root -> Folder1 Root -> Folder2
etc Root contains a conftest file with the sessionfinish hook
def pytest_sessionfinish(session, exitstatus):
each of the other folders also has a conftest of it's own None of the internal folders have the pytest_sessionfinish hook in them The working directory from which all the tests run is the root folder
For some reason , Folder1 does reach the session finish hook but Folder2 does not
can anyone explain to me how pytest chooses to use the hook from the conftest in root and how can i make sure the test in Dolder2 uses it ?
There isn't a lot to try when i put it in the conftest in folder2 it works , when i use it in conftest in root , it doesn't It does the same thing for both tests so i would rather not duplicate it into the inner conftest