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
Boxiang Sun
cython
Commits
533aa388
Commit
533aa388
authored
Aug 24, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support test skipping also in run tests.
parent
b1f7ef11
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
runtests.py
runtests.py
+10
-4
No files found.
runtests.py
View file @
533aa388
...
...
@@ -65,6 +65,8 @@ except ImportError:
try
:
from
unittest
import
SkipTest
except
ImportError
:
class
SkipTest
(
Exception
):
# don't raise, only provided to allow except-ing it!
pass
def
skip_test
(
reason
):
print
(
"Skipping test: %s"
%
reason
)
else
:
...
...
@@ -1025,7 +1027,7 @@ class CythonCompileTestCase(unittest.TestCase):
newext = fixer(extension)
if newext is EXCLUDE_EXT:
return skip_test("Test '%s' excluded due to tags '%s'" % (
self.name, ', '.join(self.tags)))
self.name, ', '.join(self.tags
.get('tag', '')
)))
extension = newext or extension
if self.language == 'cpp':
extension.language = 'c++'
...
...
@@ -1174,7 +1176,7 @@ class CythonRunTestCase(CythonCompileTestCase):
try:
self.success = False
ext_so_path = self.runCompileTest()
failures, errors
= len(result.failures), len(result.errors
)
failures, errors
, skipped = len(result.failures), len(result.errors), len(result.skipped
)
if not self.cython_only and ext_so_path is not None:
self.run_tests(result, ext_so_path)
if failures == len(result.failures) and errors == len(result.errors):
...
...
@@ -1182,6 +1184,9 @@ class CythonRunTestCase(CythonCompileTestCase):
self.success = True
finally:
check_thread_termination()
except SkipTest as exc:
result.addSkip(self, str(exc))
result.stopTest(self)
except Exception:
result.addError(self, sys.exc_info())
result.stopTest(self)
...
...
@@ -1363,17 +1368,18 @@ class PartialTestResult(_TextTestResult):
def data(self):
self.strip_error_results(self.failures)
self.strip_error_results(self.errors)
return (self.failures, self.errors, self.testsRun,
return (self.failures, self.errors, self.
skipped, self.
testsRun,
self.stream.getvalue())
def join_results(result, data):
"""
Static
method
for
merging
the
result
back
into
the
main
result
object
.
"""
failures, errors, tests_run, output = data
failures, errors,
skipped,
tests_run, output = data
if output:
result.stream.write(output)
result.errors.extend(errors)
result.skipped.extend(skipped)
result.failures.extend(failures)
result.testsRun += tests_run
...
...
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