[issue25109] test_code_module tests fail when run from the installed location

Matthias Klose report at bugs.python.org
Mon Sep 14 13:26:51 CEST 2015


New submission from Matthias Klose:

seen when running the tests in the installed location:

the test expects:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
ValueError

but it gets:

Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
ValueError

same for the other failing test case.

Re-running test 'test_code_module' in verbose mode
test_banner (test.test_code_module.TestInteractiveConsole) ... ok
test_cause_tb (test.test_code_module.TestInteractiveConsole) ... FAIL
test_console_stderr (test.test_code_module.TestInteractiveConsole) ... ok
test_context_tb (test.test_code_module.TestInteractiveConsole) ... FAIL
test_ps1 (test.test_code_module.TestInteractiveConsole) ... ok
test_ps2 (test.test_code_module.TestInteractiveConsole) ... ok
test_syntax_error (test.test_code_module.TestInteractiveConsole) ... ok
test_sysexcepthook (test.test_code_module.TestInteractiveConsole) ... ok

======================================================================
FAIL: test_cause_tb (test.test_code_module.TestInteractiveConsole)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.5/test/test_code_module.py", line 96, in test_cause_tb
    self.assertIn(expected, output)
AssertionError: '\nAttributeError\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "<console>", line 1, in <module>\nValueError\n' not found in 'Python <MagicMock name=\'sys.version\' id=\'139948544843304\'> on <MagicMock name=\'sys.platform\' id=\'139948544946784\'>\nType "help", "copyright", "credits" or "license" for more information.\n(InteractiveConsole)\nAttributeError\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "/usr/lib/python3.5/code.py", line 91, in runcode\n    exec(code, self.locals)\n  File "<console>", line 1, in <module>\nValueError\n\n'

======================================================================
FAIL: test_context_tb (test.test_code_module.TestInteractiveConsole)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.5/test/test_code_module.py", line 114, in test_context_tb
    self.assertIn(expected, output)
AssertionError: '\nTraceback (most recent call last):\n  File "<console>", line 1, in <module>\nNameError: name \'ham\' is not defined\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "<console>", line 2, in <module>\nNameError: name \'eggs\' is not defined\n' not found in 'Python <MagicMock name=\'sys.version\' id=\'139948132216360\'> on <MagicMock name=\'sys.platform\' id=\'139948132186544\'>\nType "help", "copyright", "credits" or "license" for more information.\n(InteractiveConsole)\nTraceback (most recent call last):\n  File "<console>", line 1, in <module>\nNameError: name \'ham\' is not defined\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/lib/python3.5/code.py", line 91, in runcode\n    exec(code, self.locals)\n  File "<console>", line 2, in <module>\nNameError: name \'eggs\' is not defined\n\n'

----------
components: Tests
messages: 250655
nosy: doko
priority: normal
severity: normal
status: open
title: test_code_module tests fail when run from the installed location
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25109>
_______________________________________


More information about the Python-bugs-list mailing list