Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5bc4fa7a
Commit
5bc4fa7a
authored
Oct 14, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the "compiler" resource with the more generic "cpu", so
as to mark CPU-heavy tests.
parent
3fbfea1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
Lib/test/regrtest.py
Lib/test/regrtest.py
+2
-3
Lib/test/support.py
Lib/test/support.py
+1
-1
Lib/test/test_io.py
Lib/test/test_io.py
+2
-0
Lib/test/test_tokenize.py
Lib/test/test_tokenize.py
+2
-2
No files found.
Lib/test/regrtest.py
View file @
5bc4fa7a
...
...
@@ -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'
,
'c
ompiler
'
,
'subprocess'
,
'urlfetch'
,
'gui'
)
'decimal'
,
'c
pu
'
,
'subprocess'
,
'urlfetch'
,
'gui'
)
TEMPDIR
=
os
.
path
.
abspath
(
tempfile
.
gettempdir
())
...
...
Lib/test/support.py
View file @
5bc4fa7a
...
...
@@ -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
))
...
...
Lib/test/test_io.py
View file @
5bc4fa7a
...
...
@@ -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
...
...
Lib/test/test_tokenize.py
View file @
5bc4fa7a
...
...
@@ -514,13 +514,13 @@ Two string literals on the same line
True
Test roundtrip on random python modules.
pass the '-uc
ompiler
' option to process the full directory.
pass the '-uc
pu
' 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("c
ompiler
"):
>>> if not support.is_resource_enabled("c
pu
"):
... testfiles = random.sample(testfiles, 10)
...
>>> for testfile in testfiles:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment