https://github.com/python/cpython/commit/cc573c70b7d5e169de2a6e4297068de407dc8d4d
commit: cc573c70b7d5e169de2a6e4297068de407dc8d4d
branch: main
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-02-11T19:07:08+03:00
summary:
gh-115282: Fix direct invocation of `test_traceback.py` (#115283)
files:
M Lib/test/test_traceback.py
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index 372fc48bf81a6a..dd9b1850adf086 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -3124,10 +3124,13 @@ def test_smoke_user_exception(self):
class MyException(Exception):
pass
- self.do_test_smoke(
- MyException('bad things happened'),
- ('test.test_traceback.TestTracebackException.'
- 'test_smoke_user_exception.<locals>.MyException'))
+ if __name__ == '__main__':
+ expected = ('TestTracebackException.'
+ 'test_smoke_user_exception.<locals>.MyException')
+ else:
+ expected = ('test.test_traceback.TestTracebackException.'
+ 'test_smoke_user_exception.<locals>.MyException')
+ self.do_test_smoke(MyException('bad things happened'), expected)
def test_from_exception(self):
# Check all the parameters are accepted.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]