diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-14 15:34:31 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-14 15:34:31 (GMT) |
commit | 5bc4fa7a4947a39cbfdd3dd2ea1019bfa0f93085 (patch) | |
tree | 2b4e69f9b4e1f13c81b2babc3e5462438b7f7d41 /Lib | |
parent | 3fbfea1fae509bebf89728c7f8c61b39ab69e489 (diff) | |
download | cpython-5bc4fa7a4947a39cbfdd3dd2ea1019bfa0f93085.zip cpython-5bc4fa7a4947a39cbfdd3dd2ea1019bfa0f93085.tar.gz cpython-5bc4fa7a4947a39cbfdd3dd2ea1019bfa0f93085.tar.bz2 |
Replace the "compiler" resource with the more generic "cpu", so
as to mark CPU-heavy tests.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/test/regrtest.py | 5 | ||||
-rw-r--r-- | Lib/test/support.py | 2 | ||||
-rw-r--r-- | Lib/test/test_io.py | 2 | ||||
-rw-r--r-- | Lib/test/test_tokenize.py | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 64d0a7c..9f18ea4 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -138,8 +138,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 - Allow 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. @@ -214,7 +213,7 @@ INTERRUPTED = -4 from test import support RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', - 'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui') + 'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui') TEMPDIR = os.path.abspath(tempfile.gettempdir()) diff --git a/Lib/test/support.py b/Lib/test/support.py index 1f69317..e48f2b3 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -1046,7 +1046,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_io.py b/Lib/test/test_io.py index dfddfb5..8784e34 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -837,6 +837,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, @@ -1105,6 +1106,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_tokenize.py b/Lib/test/test_tokenize.py index 4a82229..3f45d9c 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -514,13 +514,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. >>> import random >>> tempdir = os.path.dirname(f) or os.curdir >>> testfiles = glob.glob(os.path.join(tempdir, "test*.py")) - >>> if not support.is_resource_enabled("compiler"): + >>> if not support.is_resource_enabled("cpu"): ... testfiles = random.sample(testfiles, 10) ... >>> for testfile in testfiles: |