GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

Conversation

@iritkatriel

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

Uh oh!

There was an error while loading. Please reload this page.

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
  • Issue: unittest: display time used by each test case #48330

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel
pythongh-48330: assert warning is emitted on unittest.TestResult with…
de69a81
… no addDuration
@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
@bedevere-bot bedevere-bot mentioned this pull request Apr 6, 2023
unittest: display time used by each test case #48330
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Apr 6, 2023
@giampaolo

giampaolo commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

Thanks. LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

giampaolo
giampaolo approved these changes Apr 6, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Apr 6, 2023
@iritkatriel
iritkatriel merged commit 52bc2e7 into python:main Apr 6, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 6, 2023
@masklinn masklinn mentioned this pull request Apr 6, 2023
Add addDuration to TestCaseFunction pytest-dev/pytest#10875
Closed
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@iritkatriel @warsaw
pythongh-48330: assert warning is emitted on unittest.TestResult with…
c238a92
… no addDuration (python#103309)
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Apr 12, 2023
@iritkatriel @hrnciar
00398: pythongh-48330: assert warning is emitted on unittest.TestResu…
bed7ec9
…lt with no addDuration (python#103309)
@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

Reviewers

@giampaolo giampaolo giampaolo approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iritkatriel @giampaolo @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.