Skip to content

Commit ed529d2

Browse files
authored
Merge pull request #13804 from pytest-dev/usageerror-module
config: set `__module__ = "pytest"` on `UsageError` and `ExitCode`
2 parents b0e4c84 + 44e9309 commit ed529d2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/_pytest/config/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class ExitCode(enum.IntEnum):
110110
#: pytest couldn't find tests.
111111
NO_TESTS_COLLECTED = 5
112112

113+
__module__ = "pytest"
114+
113115

114116
class ConftestImportFailure(Exception):
115117
def __init__(

src/_pytest/config/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
class UsageError(Exception):
88
"""Error in pytest usage or invocation."""
99

10+
__module__ = "pytest"
11+
1012

1113
class PrintHelp(Exception):
1214
"""Raised when pytest should print its help to skip the rest of the

0 commit comments

Comments
 (0)