Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions launch_testing/launch_testing/pytest/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,16 @@ def pytest_pycollect_makemodule(path, parent):
if module is not None:
return module
if path.basename == '__init__.py':
return pytest.Package(path, parent)
return pytest.Module(path, parent)
try:
# since pytest 5
return pytest.Package.from_parent(parent, fspath=path)
except AttributeError:
return pytest.Package(path, parent)
try:
# since pytest 5
return pytest.Module.from_parent(parent, fspath=path)
except AttributeError:
return pytest.Module(path, parent)


@pytest.hookimpl(trylast=True)
Expand Down