Skip to content

Conversation

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Apr 6, 2023

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 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 iritkatriel requested a review from giampaolo April 6, 2023 10:21
@giampaolo
Copy link
Contributor

Thanks. LGTM.

@iritkatriel 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 iritkatriel deleted the warning branch July 25, 2023 18:05
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