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

index c2c44e5c841570deaaff94b41ac58d91d2b67c4d..cac3c8c4a7913106c32df8e800517c2e8da48d62 100755 (executable)
@@ -115,8 +115,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.
 
@@ -178,7 +177,7 @@ if sys.platform == 'darwin':
 from test import support
 
 RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
-                  'decimal', 'compiler', 'subprocess', 'urlfetch', 'gui')
+                  'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')
 
 
 def usage(msg):
index 34005e857ebf19ec0fabda6e0ea159e2ce089e00..842cda6c349580caae8fdaec10b365b228d16b0c 100644 (file)
@@ -873,7 +873,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 4c7ce311418db92575e616fd67d5e7c4c9c163d8..fe361be933a8ee03788596782ec739c1a17325c6 100644 (file)
@@ -803,6 +803,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
 
         self.assertEquals(b"abcdefg", bufio.read())
 
+    @support.requires_resource('cpu')
     def test_threads(self):
         try:
             # Write out many bytes with exactly the same number of 0's,
@@ -1070,6 +1071,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
         with self.open(support.TESTFN, "rb", buffering=0) as f:
             self.assertEqual(f.read(), b"abc")
 
+    @support.requires_resource('cpu')
     def test_threads(self):
         try:
             # Write out many bytes from many threads and test they were
index eeefce158d00fb463e6772f778836e669cccddd9..5a25251d9004a2da3440fd7782315e09bc0ea7dc 100644 (file)
@@ -516,13 +516,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: