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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
3f2537db
Commit
3f2537db
authored
6 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
3.0a6-cypclass
3.0a5-cypclass_pyobject_virtual
3.0a5-cypclass_virtual
3.0a6-cypclass-remove-logging
3.0a6-cypclass_attribute_lock
3.0a6-cypclass_attribute_lock_nonrecursive_rw
3.0a6-cypclass_consume
3.0a6-cypclass_frozen
3.0a6-cypclass_lock
3.0a6-cypclass_recover_consume
cypclass_pyobject
cypclass_pyobject_virtual
cypclass_virtual
nogil_cypclass_acthon_on_rc8v3
3.0a6
3.0a5
3.0a4
3.0a3
3.0a2
3.0a1
snippets_article
nogil_cypclass_rc8
nogil_cypclass_lock_on_rc8v3
cythonplus-0.3
cythonplus-0.2
cythonplus-0.1
cypclass_pyobject_before_mro_rebase_12_06_2020
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