FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-48330: assert warning is emitted on unittest.TestResult with no addDuration by iritkatriel · Pull Request #103309 · python/cpython · GitHub

Repository navigation

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

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


Back | FazBrowse Home | New Git URL