This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年04月13日 00:51 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_warnings.patch | vstinner, 2016年04月13日 00:51 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg263291 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2016年04月13日 00:51 | |
---
$ ./python -Wd -m test -j0 test_warnings
Run tests in parallel using 6 child processes
0:00:01 [1/1] test_warnings
(...)
Warning -- warnings.filters was modified by test_warnings
1 test altered the execution environment:
test_warnings
Total duration: 0:00:02
---
The problem are these two lines in test_warnings/__init__.py:
---
py_warnings = support.import_fresh_module('warnings', blocked=['_warnings'])
c_warnings = support.import_fresh_module('warnings', fresh=['_warnings'])
---
Each fresh "import warnings" calls _processoptions(sys.warnoptions) which can change warning filters.
Attached patch saves/restores warnings.filter to fix the resource warning from the test suite.
Note: the warning is not emited if tests are run sequentially (without the -jN option).
|
|||
| msg263294 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年04月13日 01:51 | |
Hmm your patch is a variation of the first patch in Issue 18383, and Serhiy’s comment about not fixing the underlying problem would apply: <https://bugs.python.org/issue18383#msg232451>. I can’t remember all the details now, but it sounds like Alex’s later patch may be a slightly more desirable hack :) |
|||
| msg266048 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2016年05月22日 04:42 | |
I suggest to use the patch from Issue 18383. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:29 | admin | set | github: 70929 |
| 2016年05月22日 04:42:01 | martin.panter | set | status: open -> closed superseder: test_warnings modifies warnings.filters when running with "-W default" resolution: duplicate messages: + msg266048 |
| 2016年04月13日 01:51:37 | martin.panter | set | nosy:
+ martin.panter messages: + msg263294 |
| 2016年04月13日 00:51:35 | vstinner | create | |