Skip to content
Closed
Changes from all commits
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
6 changes: 6 additions & 0 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,12 @@ def __init__(
def setup(self) -> None:
init_mod = importtestmodule(self.path / "__init__.py", self.config)

# Read pytestmark from the __init__.py module.
init_marks = get_unpacked_marks(init_mod)
if init_marks:
self.own_markers.extend(init_marks)
self.keywords.update((mark.name, mark) for mark in init_marks)

# Not using fixtures to call setup_module here because autouse fixtures
# from packages are not called automatically (#4085).
setup_module = _get_first_non_fixture_func(
Expand Down