Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
3f2537db
Commit
3f2537db
authored
5 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify some Py2 checks in the test runner.
parent
33e73a70
master
knext
x/compilebench
x/ctuple_vs_pair
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
runtests.py
runtests.py
+3
-5
No files found.
runtests.py
View file @
3f2537db
...
@@ -29,6 +29,7 @@ try:
...
@@ -29,6 +29,7 @@ try:
except
(
ImportError
,
AttributeError
):
except
(
ImportError
,
AttributeError
):
IS_CPYTHON
=
True
IS_CPYTHON
=
True
IS_PYPY
=
False
IS_PYPY
=
False
IS_PY2
=
sys
.
version_info
[
0
]
<
3
from
io
import
open
as
io_open
from
io
import
open
as
io_open
try
:
try
:
...
@@ -1911,7 +1912,7 @@ class ShardExcludeSelector(object):
...
@@ -1911,7 +1912,7 @@ class ShardExcludeSelector(object):
self.shard_num = shard_num
self.shard_num = shard_num
self.shard_count = shard_count
self.shard_count = shard_count
def __call__(self, testname, tags=None, _hash=zlib.crc32, _is_py2=
sys.version_info[0] < 3
):
def __call__(self, testname, tags=None, _hash=zlib.crc32, _is_py2=
IS_PY2
):
# Cannot use simple hash() here as shard processes might use different hash seeds.
# Cannot use simple hash() here as shard processes might use different hash seeds.
# CRC32 is fast and simple, but might return negative values in Py2.
# CRC32 is fast and simple, but might return negative values in Py2.
hashval = _hash(testname) & 0x7fffffff if _is_py2 else _hash(testname.encode())
hashval = _hash(testname) & 0x7fffffff if _is_py2 else _hash(testname.encode())
...
@@ -2493,10 +2494,7 @@ def runtests(options, cmd_args, coverage=None):
...
@@ -2493,10 +2494,7 @@ def runtests(options, cmd_args, coverage=None):
else:
else:
text_runner_options = {}
text_runner_options = {}
if options.failfast:
if options.failfast:
if sys.version_info < (2, 7):
text_runner_options['failfast'] = True
sys.stderr.write("--failfast not supported with Python < 2.7
\
n
")
else:
text_runner_options['failfast'] = True
test_runner = unittest.TextTestRunner(verbosity=options.verbosity, **text_runner_options)
test_runner = unittest.TextTestRunner(verbosity=options.verbosity, **text_runner_options)
if options.pyximport_py:
if options.pyximport_py:
...
...
This diff is collapsed.
Click to expand it.
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