]> granicus.if.org Git - python/commitdiff
Merged revisions 85482 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 14 Oct 2010 15:43:25 +0000 (15:43 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 14 Oct 2010 15:43:25 +0000 (15:43 +0000)
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.
........

Lib/test/regrtest.py
Lib/test/test_compiler.py
Lib/test/test_io.py
Lib/test/test_support.py
Lib/test/test_tokenize.py

index 2cc9700d47e4edbca910307bad35652b6cfe2f9d..a41c4ef5144f93fe292b8d4868351e34b81a229f 100755 (executable)
@@ -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())
index 6394b53a0cf8262ac558f0831e4dde77a132b80c..e36a3551da5acfcabd7f4ffe5d2fe2aaef04f323 100644 (file)
@@ -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__":
index 38cbcbcc2bf6f8f454da0d28932002a624aee4f4..2b4a3a95dab22ffcd0b5e0b45ce7e385bd53e09b 100644 (file)
@@ -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
index 58c84559eafd889afb84ee923714f3f761cf916c..6c2b2b2397487bbde39a712a24c67ea6dae75188 100644 (file)
@@ -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))
index b945d618b581f5b2c7085d121caddb431d0a1728..38da106cb6537ee1830b41e4f1f65a360d57f364 100644 (file)
@@ -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: