testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00188
[Bug 663558] [NEW] Test suite broken on Python 3 by monkey changes
Public bug reported:
Trying to run the test suite with Python 3 fails with:
Traceback (most recent call last):
File "...\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "...\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "...\testtools\run.py", line 280, in <module>
program = TestProgram(argv=sys.argv, testRunner=runner)
File "...\testtools\run.py", line 133, in __init__
self.parseArgs(argv)
File "...\testtools\run.py", line 188, in parseArgs
self.createTests()
File "...\testtools\run.py", line 197, in createTests
self.module)
File "...\py3k\lib\unittest\loader.py", line 132, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "...\py3k\lib\unittest\loader.py", line 132, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "...\py3k\lib\unittest\loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "testtools\tests\__init__.py", line 6, in <module>
from testtools.tests import (
File "testtools\tests\test_monkey.py", line 135
raise RuntimeError, "Something went wrong!"
^
SyntaxError: invalid syntax
Need to init the exception yourself if aiming for source compatibility,
rather than giving a class and a string expecting the interpreter to do
it.
** Affects: testtools
Importance: Undecided
Status: New
--
Test suite broken on Python 3 by monkey changes
https://bugs.launchpad.net/bugs/663558
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.
Status in testtools: New
Bug description:
Trying to run the test suite with Python 3 fails with:
Traceback (most recent call last):
File "...\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "...\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File "...\testtools\run.py", line 280, in <module>
program = TestProgram(argv=sys.argv, testRunner=runner)
File "...\testtools\run.py", line 133, in __init__
self.parseArgs(argv)
File "...\testtools\run.py", line 188, in parseArgs
self.createTests()
File "...\testtools\run.py", line 197, in createTests
self.module)
File "...\py3k\lib\unittest\loader.py", line 132, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "...\py3k\lib\unittest\loader.py", line 132, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "...\py3k\lib\unittest\loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "testtools\tests\__init__.py", line 6, in <module>
from testtools.tests import (
File "testtools\tests\test_monkey.py", line 135
raise RuntimeError, "Something went wrong!"
^
SyntaxError: invalid syntax
Need to init the exception yourself if aiming for source compatibility, rather than giving a class and a string expecting the interpreter to do it.
Follow ups
References