-
I have this hierarchy of files: In the conftest.py (1) I have this:
However, the printout is like this:
The root_fixture is run as if it's "session" scoped. Am I doing something wrong or is this a bug? If I change the root_fixture's scope to "module" ... it behaves as I would expect.
Am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
I believe this is the expected behavior, and the confusion may be coming from (the somewhat confusing) definitions of modules and packages (see the docs for the canonical definitions). In this case, I believe that your directory Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
ah ... I see. I didn't see the |
Beta Was this translation helpful? Give feedback.
In other words
package1
andpackage2
are subpackages, and the@pytest.fixture(scope="package")
decorator only refers to the outer package, not the subpackages.