File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
launch_testing/launch_testing/pytest Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,18 @@ def pytest_pycollect_makemodule(path, parent):
110110 if module is not None :
111111 return module
112112 if path .basename == '__init__.py' :
113- return pytest .Package (path , parent )
114- return pytest .Module (path , parent )
113+ try :
114+ # since https://docs.pytest.org/en/latest/changelog.html#deprecations
115+ # todo: remove fallback once all platforms use pytest >=5.4
116+ return pytest .Package .from_parent (parent , fspath = path )
117+ except AttributeError :
118+ return pytest .Package (path , parent )
119+ try :
120+ # since https://docs.pytest.org/en/latest/changelog.html#deprecations
121+ # todo: remove fallback once all platforms use pytest >=5.4
122+ return pytest .Module .from_parent (parent , fspath = path )
123+ except AttributeError :
124+ return pytest .Module (path , parent )
115125
116126
117127@pytest .hookimpl (trylast = True )
You can’t perform that action at this time.
0 commit comments