Issue 19535: Test failures with -OO (original) (raw)
Created on 2013-11-09 09:21 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Messages (10)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-09 09:21
$ ./python -OO -m test.regrtest test_docxmlrpc test_functools test_inspect test_pkg [1/4] test_docxmlrpc test test_docxmlrpc failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_docxmlrpc.py", line 210, in test_annotations response.read()) AssertionError: b'
- annotation(x: int)
- Use function annotations.
- method_annotation(x: bytes)
\n DocXMLRPCServer Test Docs</td\n> |
This is an XML-RPC server's documentation, but the server can be used by POSTing to /RPC2. Try self.add, too.
\n\n
\nMethods | ||
\n |
|
[2/4/1] test_functools test test_functools failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_functools.py", line 1127, in test_wrapping_attributes self.assertEqual(g.doc, "Simple test") AssertionError: None != 'Simple test'
[3/4/2] test_inspect test test_inspect failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_inspect.py", line 2528, in test_details self.assertIn(module.cached, output) AssertionError: '/home/serhiy/py/cpython/Lib/unittest/pycache/init.cpython-34.pyo' not found in "Target: unittest\nOrigin: /home/serhiy/py/cpython/Lib/unittest/init.py\nCached: /home/serhiy/py/cpython/Lib/unittest/pycache/init.cpython-34.pyc\nLoader: <_frozen_importlib.SourceFileLoader object at 0xb7041c4c>\nSubmodule search path: ['/home/serhiy/py/cpython/Lib/unittest']\n\n\n"
[4/4/3] test_pkg 1 test OK. 3 tests failed: test_docxmlrpc test_functools test_inspect
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-09 09:25
Failure of test_pkg is sporadic.
$ ./python -OO -m test.regrtest test_pkg [1/1] test_pkg test test_pkg failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_pkg.py", line 259, in test_7 'name', 'package', 'path']) AssertionError: Lists differ: ['__c[22 chars]file', 'loader', 'name', 'package'] != ['__c[22 chars]file', 'loader', 'name', 'package', 'path']
Second list contains 1 additional elements. First extra element 6: path
- ['cached', 'doc', 'file', 'loader', 'name', 'package']
- ['cached',
- 'doc',
- 'file',
- 'loader',
- 'name',
- 'package',
- 'path']
1 test failed: test_pkg
Author: Terry J. Reedy (terry.reedy) *
Date: 2013-11-16 00:37
I presume a test could detect docstring stripping with
def f(): 'docstring' if f.doc is None:
This would cover the test_functools case, but I don't know about the others.
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-16 10:51
Here is a patch.
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-16 17:47
Actually test_inspect is affected by -O. Here is updated patch.
Author: Ezio Melotti (ezio.melotti) *
Date: 2013-11-16 18:16
Patch LGTM. I'm getting 4 additional failures on 3.4: test_asyncio test_contextlib test_email test_statistics
- test_statistics is fixed by the attached patch.
- test_email fails in Lib/email/_policybase.py:95 -- this probably deservers a separate issue.
- test_contextlib fails in Lib/test/test_contextlib.py:107 even though these tests are decorated with @support.requires_docstrings (defined in Lib/test/support/init.py:1716). Even with -00 the _check_docstrings function seems to have a docstring (the exact line I used to run the tests is "./python -OO -m test -v test_contextlib").
test_asyncio has lot of failures, and most of them look like:
Traceback (most recent call last): File "/home/wolf/dev/py/py3k/Lib/ ERROR: test_call_later (test.test_asyncio.test_events.PollEventLoopTests)test/test_asyncio/test_events.py", line 1315, in setUp super().setUp() File "/home/wolf/dev/py/py3k/Lib/test/test_asyncio/test_events.py", line 188, in setUp events.set_event_loop(None) File "/home/wolf/dev/py/py3k/Lib/asyncio/events.py", line 423, in set_event_loop get_event_loop_policy().set_event_loop(loop) AttributeError: 'object' object has no attribute 'set_event_loop' Without -OO test_asyncio works fine. I haven't investigated this further.
Author: Ezio Melotti (ezio.melotti) *
Date: 2013-11-16 18:22
I created #19626 for the test_email failures.
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-16 19:42
Updated patch fixes test_contextlib and test_statistics too. I think test_asyncio is worth separated issue too.
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2013-11-16 19:45
Ah, test_contextlib shouldn't be fixed. It failed due to cached non-optimized test.support.
Author: Roundup Robot (python-dev)
Date: 2013-12-08 16:16
New changeset 910b1cb5176c by Serhiy Storchaka in branch '3.3': Issue #19535: Fixed test_docxmlrpc when python is run with -OO. http://hg.python.org/cpython/rev/910b1cb5176c
New changeset e71142abf8b6 by Serhiy Storchaka in branch 'default': Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and http://hg.python.org/cpython/rev/e71142abf8b6
History
Date
User
Action
Args
2022-04-11 14:57:53
admin
set
github: 63734
2013-12-08 16:17:47
serhiy.storchaka
set
status: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 2.7
2013-12-08 16:16:36
python-dev
set
nosy: + python-dev
messages: +
2013-11-16 19:45:52
serhiy.storchaka
set
messages: +
2013-11-16 19:42:04
serhiy.storchaka
set
files: + issue19535_3.patch
messages: +
2013-11-16 18:22:49
ezio.melotti
set
dependencies: + test_email and Lib/email/_policybase.py failures with -OO
messages: +
2013-11-16 18:16:54
ezio.melotti
set
files: + issue19535_statistics.diff
nosy: + r.david.murray, ezio.melotti
messages: +
2013-11-16 17:47:22
serhiy.storchaka
set
files: + issue19535_2.patch
messages: +
2013-11-16 10:51:35
serhiy.storchaka
set
files: + issue19535.patch
messages: +
assignee: serhiy.storchaka
keywords: + patch
stage: patch review
2013-11-16 00:37:17
terry.reedy
set
nosy: + terry.reedy
messages: +
2013-11-09 09:25:42
serhiy.storchaka
set
messages: +
2013-11-09 09:21:22
serhiy.storchaka
create