Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failure introduced by the fix for issue #22462 #67084

Closed
doko42 opened this issue Nov 18, 2014 · 10 comments
Closed

test failure introduced by the fix for issue #22462 #67084

doko42 opened this issue Nov 18, 2014 · 10 comments
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@doko42
Copy link
Member

doko42 commented Nov 18, 2014

BPO 22895
Nosy @doko42, @pitrou, @jkloth, @merwok

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2014-11-29.14:57:17.563>
created_at = <Date 2014-11-18.12:03:32.375>
labels = ['tests', 'type-bug', 'library']
title = 'test failure introduced by the fix for issue python/cpython#66652'
updated_at = <Date 2014-11-29.14:57:17.562>
user = 'https://github.com/doko42'

bugs.python.org fields:

activity = <Date 2014-11-29.14:57:17.562>
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date = <Date 2014-11-29.14:57:17.563>
closer = 'pitrou'
components = ['Library (Lib)', 'Tests']
creation = <Date 2014-11-18.12:03:32.375>
creator = 'doko'
dependencies = []
files = []
hgrepos = []
issue_num = 22895
keywords = []
message_count = 10.0
messages = ['231312', '231317', '231320', '231322', '231436', '231445', '231548', '231561', '231862', '231864']
nosy_count = 5.0
nosy_names = ['doko', 'pitrou', 'jkloth', 'eric.araujo', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22895'
versions = ['Python 3.4', 'Python 3.5']

@doko42
Copy link
Member Author

doko42 commented Nov 18, 2014

the fix for issue bpo-22462 introduces a regression in the test_pyexpat test cases. I'm not yet sure why. This is only seen when running the testsuite from the installed location, which shouldn't matter. Tried to run the tests with a stripped executable in the build tree worked too, so I'm lost why this now fails. Confirmed that reverting the fix resolves running the testcase in the same environment.

@doko42 doko42 added the stdlib Python modules in the Lib dir label Nov 18, 2014
@pitrou
Copy link
Member

pitrou commented Nov 18, 2014

Please post the traceback.

@doko42
Copy link
Member Author

doko42 commented Nov 18, 2014

[258/383] test_pyexpat
test test_pyexpat failed -- Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 432, in test_exception
    parser.Parse(b"<a><b><c/></b></a>", 1)
  File "../Modules/pyexpat.c", line 405, in StartElement
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 422, in StartElementHandler
    raise RuntimeError(name)
RuntimeError: a

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 447, in test_exception
    self.assertIn('call_with_frame("StartElement"', entries[1][3])
  File "/usr/lib/python3.4/unittest/case.py", line 1053, in assertIn
    if member not in container:
TypeError: argument of type 'NoneType' is not iterable

test_exception (test.test_pyexpat.HandlerExceptionTest) ... ERROR

======================================================================
ERROR: test_exception (test.test_pyexpat.HandlerExceptionTest)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 432, in test_exception
    parser.Parse(b"<a><b><c/></b></a>", 1)
  File "../Modules/pyexpat.c", line 405, in StartElement
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 422, in StartElementHandler
    raise RuntimeError(name)
RuntimeError: a

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/test/test_pyexpat.py", line 447, in test_exception
    self.assertIn('call_with_frame("StartElement"', entries[1][3])
  File "/usr/lib/python3.4/unittest/case.py", line 1053, in assertIn
    if member not in container:
TypeError: argument of type 'NoneType' is not iterable

Ran 36 tests in 0.016s

@pitrou
Copy link
Member

pitrou commented Nov 18, 2014

Thanks. So, this is not a regression: the failing test was introduced in bpo-22462 and probably would have not worked before, either. The problem is that "../Modules/pyexpat.c" makes sense from the checkout directory but not necessarily from the install location. I don't know if we should try to be smarter or not.

At first we could make the test more lenient.

@pitrou pitrou added the tests Tests in the Lib/test dir label Nov 18, 2014
@pitrou pitrou changed the title regression introduced by the fix for issue #22462 test failure introduced by the fix for issue #22462 Nov 18, 2014
@pitrou pitrou added the type-bug An unexpected behavior, bug, or error label Nov 18, 2014
@doko42
Copy link
Member Author

doko42 commented Nov 20, 2014

do we have something like skipIfInstalled?

@pitrou
Copy link
Member

pitrou commented Nov 20, 2014

do we have something like skipIfInstalled?

No. There's no exact way of checking for an installed Python, but one possibility is to test whether a given directory exists (e.g. "Modules").

@merwok
Copy link
Member

merwok commented Nov 23, 2014

What about using “not sysconfig.is_python_build()”?

@pitrou
Copy link
Member

pitrou commented Nov 23, 2014

What about using “not sysconfig.is_python_build()”?

I had forgotten about it, thank you.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Nov 29, 2014

New changeset e4b986350feb by Antoine Pitrou in branch '3.4':
Close issue bpo-22895: fix test failure introduced by the fix for issue bpo-22462.
https://hg.python.org/cpython/rev/e4b986350feb

New changeset 4990157343c6 by Antoine Pitrou in branch 'default':
Close issue bpo-22895: fix test failure introduced by the fix for issue bpo-22462.
https://hg.python.org/cpython/rev/4990157343c6

@pitrou
Copy link
Member

pitrou commented Nov 29, 2014

This should be fixed now.

@pitrou pitrou closed this as completed Nov 29, 2014
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants