Skip to content

Commit 9d8bbcd

Browse files
committed
Resolve flake8 error by replacing pytest.raises(Exception) with SystemError
1 parent e53d58a commit 9d8bbcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_def_submodule_failures():
107107
sm_name_orig = sm.__name__
108108
sm.__name__ = malformed_utf8
109109
try:
110-
with pytest.raises(Exception):
110+
with pytest.raises(SystemError):
111111
# Seen with Python 3.9: SystemError: nameless module
112112
# But we do not want to exercise the internals of PyModule_GetName(), which could
113113
# change in future versions of Python, but a bad __name__ is very likely to cause

0 commit comments

Comments
 (0)