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
922ea7ae
Commit
922ea7ae
authored
Jun 28, 2010
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip* decorators for tests
parent
eb76397c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
t/test_util.py
t/test_util.py
+12
-3
No files found.
t/test_util.py
View file @
922ea7ae
#!/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
import
re
import
subprocess
import
re
,
subprocess
,
sys
def
process_ipcmd
(
str
):
cur
=
None
...
...
@@ -63,4 +62,14 @@ def get_devs_netns(node):
(outdata, errdata) = node.run_process(["ip", "addr", "list"])
return process_ipcmd(outdata)
# 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
))
return
None
return
banner
def
skipUnless
(
cond
,
text
):
return
skip
(
text
)
if
not
cond
else
lambda
f
:
f
def
skipIf
(
cond
,
text
):
return
skip
(
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