Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
a6845a04
Commit
a6845a04
authored
10 years ago
by
Gregory Szorc
Browse files
Options
Downloads
Patches
Plain Diff
run-tests: record ignored tests by raising IgnoreTest
parent
867a1116
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/run-tests.py
+9
-3
9 additions, 3 deletions
tests/run-tests.py
with
9 additions
and
3 deletions
tests/run-tests.py
+
9
−
3
View file @
a6845a04
...
...
@@ -616,6 +616,9 @@
return
'
s
'
,
self
.
name
,
msg
def
ignore
(
self
,
msg
):
if
self
.
_unittest
:
raise
IgnoreTest
(
msg
)
return
'
i
'
,
self
.
name
,
msg
class
PythonTest
(
Test
):
...
...
@@ -985,6 +988,9 @@
class
SkipTest
(
Exception
):
"""
Raised to indicate that a test is to be skipped.
"""
class
IgnoreTest
(
Exception
):
"""
Raised to indicate that a test is to be ignored.
"""
class
TestResult
(
unittest
.
_TextTestResult
):
"""
Holds results when executing via unittest.
"""
# Don't worry too much about accessing the non-public _TextTestResult.
...
...
@@ -1342,6 +1348,8 @@
raise
except
SkipTest
,
e
:
result
.
addSkip
(
self
,
str
(
e
))
except
IgnoreTest
,
e
:
result
.
addIgnore
(
self
,
str
(
e
))
except
self
.
failureException
:
result
.
addFailure
(
self
,
sys
.
exc_info
())
except
Exception
:
...
...
@@ -1356,6 +1364,4 @@
self
.
_result
.
failures
.
append
((
self
,
msg
))
elif
code
==
'
~
'
:
self
.
_result
.
addWarn
(
self
,
msg
)
elif
code
==
'
i
'
:
self
.
_result
.
addIgnore
(
self
,
msg
)
# Codes handled in run().
...
...
@@ -1361,5 +1367,5 @@
# Codes handled in run().
elif
code
in
(
'
.
'
,
'
s
'
):
elif
code
in
(
'
.
'
,
'
s
'
,
'
i
'
):
pass
else
:
self
.
fail
(
'
Unknown test result code: %s
'
%
code
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment