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
Feb 23, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify some Py2 checks in the test runner.
parent
33e73a70
Changes
1
Show 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:
except
(
ImportError
,
AttributeError
):
IS_CPYTHON
=
True
IS_PYPY
=
False
IS_PY2
=
sys
.
version_info
[
0
]
<
3
from
io
import
open
as
io_open
try
:
...
...
@@ -1911,7 +1912,7 @@ class ShardExcludeSelector(object):
self.shard_num = shard_num
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.
# CRC32 is fast and simple, but might return negative values in Py2.
hashval = _hash(testname) & 0x7fffffff if _is_py2 else _hash(testname.encode())
...
...
@@ -2493,9 +2494,6 @@ def runtests(options, cmd_args, coverage=None):
else:
text_runner_options = {}
if options.failfast:
if sys.version_info < (2, 7):
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)
...
...
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