You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixtures can have function, class, and module specific behavior by inspecting request but not package specific behavior, even for package scoped fixtures.
Describe the solution you'd like
Add a package property to FeatureRequest, similar to the current module property, that returns the closest node of type Package.
Alternative Solutions
Current solution would be to have separate fixtures in each package, rather than one fixture with package-specific behavior.
The text was updated successfully, but these errors were encountered:
Hi @apvd, can you describe your use case for getting the package?
I'd mention that packages are a bit different than the others in that packages can be nested, and thus there may be multiple package "scopes" active at the same time. So there a chance of some confusion, e.g.
root/
__init__.py
sub/
__init__.py
test_it.py
Say the test is in test_it.py and the fixture is in root. Using request.package in the fixture will return package sub, but maybe some users expect it to be root.
What's the problem this feature will solve?
Fixtures can have function, class, and module specific behavior by inspecting
request
but not package specific behavior, even for package scoped fixtures.Describe the solution you'd like
Add a
package
property toFeatureRequest
, similar to the currentmodule
property, that returns the closest node of typePackage
.Alternative Solutions
Current solution would be to have separate fixtures in each package, rather than one fixture with package-specific behavior.
The text was updated successfully, but these errors were encountered: