Add a module to the test suite which contains all of the other ported modules
This commit is contained in:
parent
f7c3c53206
commit
76e5c40fc6
37
src/allmydata/test/python3_tests.py
Normal file
37
src/allmydata/test/python3_tests.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
"""
|
||||||
|
This module defines the subset of the full test suite which is expected to
|
||||||
|
pass on Python 3 in a way which makes that suite discoverable by trial.
|
||||||
|
|
||||||
|
This module has been ported to Python 3.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from __future__ import absolute_import
|
||||||
|
from __future__ import division
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
from future.utils import PY2
|
||||||
|
if PY2:
|
||||||
|
from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
|
||||||
|
|
||||||
|
from twisted.python.reflect import (
|
||||||
|
namedModule,
|
||||||
|
)
|
||||||
|
from twisted.trial.runner import (
|
||||||
|
TestLoader,
|
||||||
|
)
|
||||||
|
from twisted.trial.unittest import (
|
||||||
|
TestSuite,
|
||||||
|
)
|
||||||
|
|
||||||
|
from allmydata.util._python3 import (
|
||||||
|
PORTED_TEST_MODULES,
|
||||||
|
)
|
||||||
|
|
||||||
|
def testSuite():
|
||||||
|
loader = TestLoader()
|
||||||
|
return TestSuite(list(
|
||||||
|
loader.loadModule(namedModule(module))
|
||||||
|
for module
|
||||||
|
in PORTED_TEST_MODULES
|
||||||
|
))
|
@ -1,6 +1,15 @@
|
|||||||
"""
|
"""
|
||||||
Track the port to Python 3.
|
Track the port to Python 3.
|
||||||
|
|
||||||
|
The two easiest ways to run the part of the test suite which is expected to
|
||||||
|
pass on Python 3 are::
|
||||||
|
|
||||||
|
$ tox -e py36
|
||||||
|
|
||||||
|
and::
|
||||||
|
|
||||||
|
$ trial allmydata.test.python3_tests
|
||||||
|
|
||||||
This module has been ported to Python 3.
|
This module has been ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -71,7 +80,3 @@ PORTED_TEST_MODULES = [
|
|||||||
"allmydata.test.test_util",
|
"allmydata.test.test_util",
|
||||||
"allmydata.test.test_version",
|
"allmydata.test.test_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
from subprocess import check_call
|
|
||||||
check_call(["trial"] + PORTED_TEST_MODULES)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user