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)

msg202476 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

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.
\n
method_annotation(x: bytes)
' not found in b'\nPython: DocXMLRPCServer Test Documentation\n\n\n\n\n\n
 
\n 
DocXMLRPCServer Test Docs</td\n>
 
\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

\n\n\n \n\n
 
\nMethods
       
<lambda>(x, y)
\n
add(x, y)
\n
annotation(x: int)
\n
method_annotation(x: bytes)
\n
system.listMethods()
\n
system.methodHelp(method_name)
\n
system.methodSignature(method_name)
\n
\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

msg202477 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

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

1 test failed: test_pkg

msg202995 - (view)

Author: Terry J. Reedy (terry.reedy) * (Python committer)

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.

msg203021 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2013-11-16 10:51

Here is a patch.

msg203067 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2013-11-16 17:47

Actually test_inspect is affected by -O. Here is updated patch.

msg203071 - (view)

Author: Ezio Melotti (ezio.melotti) * (Python committer)

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

msg203073 - (view)

Author: Ezio Melotti (ezio.melotti) * (Python committer)

Date: 2013-11-16 18:22

I created #19626 for the test_email failures.

msg203078 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2013-11-16 19:42

Updated patch fixes test_contextlib and test_statistics too. I think test_asyncio is worth separated issue too.

msg203079 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2013-11-16 19:45

Ah, test_contextlib shouldn't be fixed. It failed due to cached non-optimized test.support.

msg205578 - (view)

Author: Roundup Robot (python-dev) (Python triager)

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