Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
feef451e
Commit
feef451e
authored
Jul 20, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better skip decorators
parent
1a04089b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
t/test_util.py
t/test_util.py
+9
-6
No files found.
t/test_util.py
View file @
feef451e
...
...
@@ -63,13 +63,16 @@ def get_devs_netns(node):
return process_ipcmd(out)
# Unittest from Python 2.6 doesn'
t
have
these
decorators
def
skip
(
text
):
def
banner
(
f
):
sys
.
stderr
.
write
(
"*** WARNING: Skipping test %s (%s): `%s'
\
n
"
%
(
f
.
__name__
,
f
.
__module__
,
text
))
def
_bannerwrap
(
f
,
text
):
name
=
f
.
__name__
def
banner
(
*
args
,
**
kwargs
):
sys
.
stderr
.
write
(
"*** WARNING: Skipping test %s: `%s'
\
n
"
%
(
name
,
text
))
return
None
return
banner
def
skip
(
text
):
return
lambda
f
:
_bannerwrap
(
f
,
text
)
def
skipUnless
(
cond
,
text
):
return
skip
(
text
)
if
not
cond
else
lambda
f
:
f
return
lambda
f
:
_bannerwrap
(
f
,
text
)
if
not
cond
else
lambda
f
:
f
def
skipIf
(
cond
,
text
):
return
skip
(
text
)
if
cond
else
lambda
f
:
f
return
lambda
f
:
_bannerwrap
(
f
,
text
)
if
cond
else
lambda
f
:
f
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