GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-92886: fixed tests that were breaking while running with basic optimizations enabled (-O, assertions off) by jackh-ncl · Pull Request #93174 · python/cpython Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -5690,45 +5690,48 @@ def test_joinable_queue(self): | |||
|
|
|||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Could be worth fixing the rest of the assertions in this file?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| code_info_consts = "0: None" | ||
| else: | ||
| code_info_consts = "0: 'Formatted details of methods, functions, or code.'" | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| @threading_helper.reap_threads | ||
| @cpython_only | ||
| @unittest.skipUnless(__debug__, "Won't work if __debug__ is False") |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
_mesg() @ Lib/imaplib.py:1247 is defined within a if __debug__ block, so I assume this test can be skipped when running with optimizations.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # assert_python_* helpers don't return proc object. We'll just use | ||
| # subprocess.run() instead of spawn_python() and its friends to test | ||
| # stdin support of the CLI. | ||
| opts = '-m' if __debug__ else '-Om' |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this actually fixed things, but it seems to have done the trick 🤷♂️
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (13, 'line'), | ||
| (13, 'return')]) | ||
| (10, 'line')] + | ||
| ([(13, 'line'), (13, 'return')] if __debug__ else [(10, 'return')])) |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The assertions on line 819 affect the line numbers we are testing here when running with optimizations.
An alternative could be for these test functions to do something other than an assert.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please limit this PR to tests only (files in the Lib/test directory). It may make sense to break this up in multiple PRs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@erlend-aasland I've split it out into several PRs, which hopefully doesn't seem too overkill. I can see there being some level of back and forth for a number of them. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thanks. One PR per file was perhaps a little bit too much, but IMO it is better than one PR for everything. IIUC, this PR is now superfluous and can be closed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
some tests fail with -O (assertions off)
There was an error while loading. Please reload this page.