Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.base
Commits
cdf7f1af
Commit
cdf7f1af
authored
Nov 11, 2020
by
Tiago de Freitas Pereira
Browse files
[py] Added decorator
parent
51c47c13
Pipeline
#45381
failed with stage
in 4 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/test/utils.py
View file @
cdf7f1af
...
...
@@ -148,3 +148,32 @@ def atnt_database_directory():
return
atnt_downloaded_directory
def
mxnet_available
(
test
):
"""Decorator to check if the mxnet is present, before running the test"""
@
functools
.
wraps
(
test
)
def
wrapper
(
*
args
,
**
kwargs
):
try
:
import
mxnet
return
test
(
*
args
,
**
kwargs
)
except
ImportError
as
e
:
raise
SkipTest
(
"Skipping test since `mxnet` is not available: %s"
%
e
)
return
wrapper
def
tensorflow_available
(
test
):
"""Decorator to check if the mxnet is present, before running the test"""
@
functools
.
wraps
(
test
)
def
wrapper
(
*
args
,
**
kwargs
):
try
:
import
tensorflow
return
test
(
*
args
,
**
kwargs
)
except
ImportError
as
e
:
raise
SkipTest
(
"Skipping test since `mxnet` is not available: %s"
%
e
)
return
wrapper
Write
Preview
Supports
Markdown
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