← 返回首页
gh-48330: assert warning is emitted on unittest.TestResult with no addDuration by iritkatriel · Pull Request #103309 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-48330: assert warning is emitted on unittest.TestResult with no addDuration#103309

Merged
iritkatriel merged 1 commit into
python:mainfrom
iritkatriel:warning
Apr 6, 2023
Merged

gh-48330: assert warning is emitted on unittest.TestResult with no addDuration#103309
iritkatriel merged 1 commit into
python:mainfrom
iritkatriel:warning

Conversation

iritkatriel commented Apr 6, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Fixes the warning below, which started with #12271.

====================================================================== ERROR: test_run_call_order_default_result (test.test_unittest.test_case.Test_TestCase.test_run_call_order_default_result) ---------------------------------------------------------------------- AttributeError: 'ResultWithNoStartTestRunStopTestRun' object has no attribute 'addDuration' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/Lib/test/test_unittest/test_case.py", line 307, in test_run_call_order_default_result Foo('test').run() File "/Users/iritkatriel/src/cpython/Lib/unittest/case.py", line 639, in run self._addDuration(result, (time.perf_counter() - start_time)) File "/Users/iritkatriel/src/cpython/Lib/unittest/case.py", line 580, in _addDuration warnings.warn("TestResult has no addDuration method", RuntimeWarning: TestResult has no addDuration method

iritkatriel added tests Tests in the Lib/test dir skip news stdlib Standard Library Python modules in the Lib/ directory labels Apr 6, 2023
iritkatriel requested a review from giampaolo April 6, 2023 10:21

Copy link
Copy Markdown
Contributor

Thanks. LGTM.

iritkatriel merged commit 52bc2e7 into python:main Apr 6, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Apr 12, 2023
iritkatriel deleted the warning branch July 25, 2023 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news stdlib Standard Library Python modules in the Lib/ directory tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Footer

© 2026 GitHub, Inc.