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
sec23
korte
pymagglobal
Commits
3c441885
Commit
3c441885
authored
Nov 27, 2020
by
Maximilian Schanner
Committed by
Maximilian Schanner
Nov 30, 2020
Browse files
catching the wrong exception
parent
05b9ce51
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_pymagglobal.py
View file @
3c441885
...
...
@@ -31,18 +31,13 @@ import pymagglobal
from
pymagglobal
import
*
class
ParserTestPackage
(
unittest
.
TestCase
):
try
:
from
packaging.version
import
Version
class
ParserTestPackage
(
unittest
.
TestCase
):
'''Unit-tests for the package i.e. __init__.py'''
try
:
def
test_version
(
self
):
from
packaging.version
import
Version
'''Check if pymagglobal.__version__ conforms PEP 440'''
version
=
Version
(
pymagglobal
.
__version__
)
except
ImportError
:
except
(
ImportError
,
ModuleNotFoundError
)
:
print
(
"Skipped version test, as the packaging package is not available."
)
def
test_models
(
self
):
'''Check if built-in model-files exist'''
for
model_fn
in
pymagglobal
.
built_in_models
().
values
():
with
self
.
subTest
(
msg
=
model_fn
):
self
.
assertTrue
(
Path
(
model_fn
).
is_file
())
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