diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-14 15:43:25 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-14 15:43:25 (GMT) |
commit | d989f820c880e7dff16293f6d2861330b5019130 (patch) | |
tree | 7f87e5e2c2ba73991c20ae7f4fd7e72384c318d2 | |
parent | 9a4acdf4a5a33e85e880de094ae7d5b0786634c8 (diff) | |
download | cpython-d989f820c880e7dff16293f6d2861330b5019130.zip cpython-d989f820c880e7dff16293f6d2861330b5019130.tar.gz cpython-d989f820c880e7dff16293f6d2861330b5019130.tar.bz2 |
Merged revisions 85482 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85482 | antoine.pitrou | 2010-10-14 17:34:31 +0200 (jeu., 14 oct. 2010) | 4 lines
Replace the "compiler" resource with the more generic "cpu", so
as to mark CPU-heavy tests.
........
-rwxr-xr-x | Lib/test/regrtest.py | 8 | ||||
-rw-r--r-- | Lib/test/test_compiler.py | 2 | ||||
-rw-r--r-- | Lib/test/test_io.py | 2 | ||||
-rw-r--r-- | Lib/test/test_support.py | 2 | ||||
-rw-r--r-- | Lib/test/test_tokenize.py | 4 |
5 files changed, 8 insertions, 10 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 2cc9700..a41c4ef 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -133,11 +133,7 @@ resources to test. Currently only the following are defined: decimal - Test the decimal module against a large suite that verifies compliance with standards. - compiler - Test the compiler package by compiling all the source - in the standard library and test suite. This takes - a long time. Enabling this resource also allows - test_tokenize to verify round-trip lexing on every - file in the test library. + cpu - Used for certain CPU-heavy tests. subprocess Run all tests for the subprocess module. @@ -215,7 +211,7 @@ INTERRUPTED = -4 from test import test_support RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb', - 'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui', + 'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui', 'xpickle') TEMPDIR = os.path.abspath(tempfile.gettempdir()) diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py index 6394b53..e36a355 100644 --- a/Lib/test/test_compiler.py +++ b/Lib/test/test_compiler.py @@ -310,7 +310,7 @@ from math import * def test_main(): global TEST_ALL - TEST_ALL = test.test_support.is_resource_enabled("compiler") + TEST_ALL = test.test_support.is_resource_enabled("cpu") test.test_support.run_unittest(CompilerTest) if __name__ == "__main__": diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 38cbcbc..2b4a3a9 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -812,6 +812,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): self.assertEquals(b"abcdefg", bufio.read()) @unittest.skipUnless(threading, 'Threading required for this test.') + @support.requires_resource('cpu') def test_threads(self): try: # Write out many bytes with exactly the same number of 0's, @@ -1081,6 +1082,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): self.assertEqual(f.read(), b"abc") @unittest.skipUnless(threading, 'Threading required for this test.') + @support.requires_resource('cpu') def test_threads(self): try: # Write out many bytes from many threads and test they were diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 58c8455..6c2b2b2 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -1004,7 +1004,7 @@ def _id(obj): return obj def requires_resource(resource): - if resource_is_enabled(resource): + if is_resource_enabled(resource): return _id else: return unittest.skip("resource {0!r} is not enabled".format(resource)) diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index b945d61..38da106 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -493,13 +493,13 @@ Two string literals on the same line True Test roundtrip on random python modules. -pass the '-ucompiler' option to process the full directory. +pass the '-ucpu' option to process the full directory. >>> >>> tempdir = os.path.dirname(f) or os.curdir >>> testfiles = glob.glob(os.path.join(tempdir, "test*.py")) - >>> if not test_support.is_resource_enabled("compiler"): + >>> if not test_support.is_resource_enabled("cpu"): ... testfiles = random.sample(testfiles, 10) ... >>> for testfile in testfiles: |