Skip to content

Commit 44e9309

Browse files
committed
config: set __module__ = "pytest" on UsageError and ExitCode
These types occasionally get displayed by their qualified name, let's make it nicer using the user-facing path.
1 parent b0e4c84 commit 44e9309

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)