I tried running `testr run` on testtools master, first with no modifications and got:
$ testr run
running=${PYTHON:-python} -m subunit.run testtools.tests.test_suite
Ran 1196 (+1195) tests in 2.071s
PASSED (id=0, skips=8)
Then with this patch:
$ git di
diff --git a/testtools/tests/matchers/test_basic.py b/testtools/tests/matchers/test_basic.py
index c53bc9e..2270646 100644
--- a/testtools/tests/matchers/test_basic.py
+++ b/testtools/tests/matchers/test_basic.py
@@ -1,5 +1,6 @@
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
+aouthaosute
import re
from testtools import TestCase
and got:
$ testr run
running=${PYTHON:-python} -m subunit.run testtools.tests.test_suite
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/subunit/run.py", line 149, in <module>
main()
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/subunit/run.py", line 145, in main
stdout=stdout, exit=False)
File "testtools/run.py", line 171, in __init__
self.parseArgs(argv)
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/main.py", line 135, in parseArgs
self.createTests()
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/main.py", line 142, in createTests
self.module)
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/loader.py", line 245, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/loader.py", line 230, in loadTestsFromName
test = obj()
File "testtools/tests/__init__.py", line 51, in test_suite
suites = map(lambda x: x.test_suite(), modules)
File "testtools/tests/__init__.py", line 51, in <lambda>
suites = map(lambda x: x.test_suite(), modules)
File "testtools/tests/matchers/__init__.py", line 8, in test_suite
from testtools.tests.matchers import (
File "testtools/tests/matchers/test_basic.py", line 3, in <module>
aouthaosute
NameError: name 'aouthaosute' is not defined
======================================================================
FAIL: process-returncode
tags: worker-0
----------------------------------------------------------------------
returncode 1
Ran 1 (-1195) tests
FAILED (id=1, failures=1 (+1))
And then with this patch:
git di
diff --git a/testtools/tests/matchers/test_basic.py b/testtools/tests/matchers/test_basic.py
index c53bc9e..5b1304c 100644
--- a/testtools/tests/matchers/test_basic.py
+++ b/testtools/tests/matchers/test_basic.py
@@ -1,5 +1,6 @@
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
+import aouthaosute
import re
from testtools import TestCase
and got:
$ testr run
running=${PYTHON:-python} -m subunit.run testtools.tests.test_suite
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/subunit/run.py", line 149, in <module>
main()
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/subunit/run.py", line 145, in main
stdout=stdout, exit=False)
File "testtools/run.py", line 171, in __init__
self.parseArgs(argv)
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/main.py", line 135, in parseArgs
self.createTests()
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/main.py", line 142, in createTests
self.module)
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/loader.py", line 245, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/unittest2/loader.py", line 230, in loadTestsFromName
test = obj()
File "testtools/tests/__init__.py", line 51, in test_suite
suites = map(lambda x: x.test_suite(), modules)
File "testtools/tests/__init__.py", line 51, in <lambda>
suites = map(lambda x: x.test_suite(), modules)
File "testtools/tests/matchers/__init__.py", line 8, in test_suite
from testtools.tests.matchers import (
File "testtools/tests/matchers/test_basic.py", line 3, in <module>
import aouthaosute
ImportError: No module named aouthaosute
======================================================================
FAIL: process-returncode
tags: worker-0
----------------------------------------------------------------------
returncode 1
Ran 1 tests
FAILED (id=6, failures=1)
So, afaict, this bug is fixed, with no changes required to testtools.
According to https:/ /bugs.launchpad .net/testtools/ +bug/1380918/ comments/ 9, this is fully fixed.
I tried running `testr run` on testtools master, first with no modifications and got:
$ testr run ${PYTHON: -python} -m subunit.run testtools. tests.test_ suite
running=
Ran 1196 (+1195) tests in 2.071s
PASSED (id=0, skips=8)
Then with this patch:
$ git di tests/matchers/ test_basic. py b/testtools/ tests/matchers/ test_basic. py tests/matchers/ test_basic. py tests/matchers/ test_basic. py
diff --git a/testtools/
index c53bc9e..2270646 100644
--- a/testtools/
+++ b/testtools/
@@ -1,5 +1,6 @@
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
+aouthaosute
import re
from testtools import TestCase
and got:
$ testr run ${PYTHON: -python} -m subunit.run testtools. tests.test_ suite Library/ Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/runpy. py", line 162, in _run_module_as_main Library/ Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/runpy. py", line 72, in _run_code jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ subunit/ run.py" , line 149, in <module> jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ subunit/ run.py" , line 145, in main parseArgs( argv) jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ main.py" , line 135, in parseArgs createTests( ) jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ main.py" , line 142, in createTests jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ loader. py", line 245, in loadTestsFromNames FromName( name, module) for name in names] jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ loader. py", line 230, in loadTestsFromName tests/_ _init__ .py", line 51, in test_suite tests/_ _init__ .py", line 51, in <lambda> tests/matchers/ __init_ _.py", line 8, in test_suite tests.matchers import ( tests/matchers/ test_basic. py", line 3, in <module> ======= ======= ======= ======= ======= ======= ======= ======= ======= ------- ------- ------- ------- ------- ------- ------- ------- -------
running=
Traceback (most recent call last):
File "/System/
"__main__", fname, loader, pkg_name)
File "/System/
exec code in run_globals
File "/Users/
main()
File "/Users/
stdout=stdout, exit=False)
File "testtools/run.py", line 171, in __init__
self.
File "/Users/
self.
File "/Users/
self.module)
File "/Users/
suites = [self.loadTests
File "/Users/
test = obj()
File "testtools/
suites = map(lambda x: x.test_suite(), modules)
File "testtools/
suites = map(lambda x: x.test_suite(), modules)
File "testtools/
from testtools.
File "testtools/
aouthaosute
NameError: name 'aouthaosute' is not defined
=======
FAIL: process-returncode
tags: worker-0
-------
returncode 1
Ran 1 (-1195) tests
FAILED (id=1, failures=1 (+1))
And then with this patch:
git di tests/matchers/ test_basic. py b/testtools/ tests/matchers/ test_basic. py tests/matchers/ test_basic. py tests/matchers/ test_basic. py
diff --git a/testtools/
index c53bc9e..5b1304c 100644
--- a/testtools/
+++ b/testtools/
@@ -1,5 +1,6 @@
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details.
+import aouthaosute
import re
from testtools import TestCase
and got:
$ testr run ${PYTHON: -python} -m subunit.run testtools. tests.test_ suite Library/ Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/runpy. py", line 162, in _run_module_as_main Library/ Frameworks/ Python. framework/ Versions/ 2.7/lib/ python2. 7/runpy. py", line 72, in _run_code jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ subunit/ run.py" , line 149, in <module> jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ subunit/ run.py" , line 145, in main parseArgs( argv) jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ main.py" , line 135, in parseArgs createTests( ) jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ main.py" , line 142, in createTests jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ loader. py", line 245, in loadTestsFromNames FromName( name, module) for name in names] jml/.virtualenv s/testtools/ lib/python2. 7/site- packages/ unittest2/ loader. py", line 230, in loadTestsFromName tests/_ _init__ .py", line 51, in test_suite tests/_ _init__ .py", line 51, in <lambda> tests/matchers/ __init_ _.py", line 8, in test_suite tests.matchers import ( tests/matchers/ test_basic. py", line 3, in <module> ======= ======= ======= ======= ======= ======= ======= ======= ======= ------- ------- ------- ------- ------- ------- ------- ------- -------
running=
Traceback (most recent call last):
File "/System/
"__main__", fname, loader, pkg_name)
File "/System/
exec code in run_globals
File "/Users/
main()
File "/Users/
stdout=stdout, exit=False)
File "testtools/run.py", line 171, in __init__
self.
File "/Users/
self.
File "/Users/
self.module)
File "/Users/
suites = [self.loadTests
File "/Users/
test = obj()
File "testtools/
suites = map(lambda x: x.test_suite(), modules)
File "testtools/
suites = map(lambda x: x.test_suite(), modules)
File "testtools/
from testtools.
File "testtools/
import aouthaosute
ImportError: No module named aouthaosute
=======
FAIL: process-returncode
tags: worker-0
-------
returncode 1
Ran 1 tests
FAILED (id=6, failures=1)
So, afaict, this bug is fixed, with no changes required to testtools.