When using a fixuture with the package scope, the request object is not of the expected type. To be accurate, the request.node is of type Session when one could expect it to be of type Package.
Versions:
- python 3.7.16
- pytest 7.3.1
Example:
import pytest
@pytest.fixture(scope="package")
def package_fixture(request):
assert False, (type(request.node), request.node)
def test_fixture(package_fixture):
pass
When using a fixuture with the
packagescope, therequestobject is not of the expected type. To be accurate, therequest.nodeis of typeSessionwhen one could expect it to be of typePackage.Versions:
Example: