Commit 3c441885 authored by Maximilian Schanner's avatar Maximilian Schanner Committed by Maximilian Schanner
Browse files

catching the wrong exception

parent 05b9ce51
......@@ -31,18 +31,13 @@ import pymagglobal
from pymagglobal import *
class ParserTestPackage(unittest.TestCase):
'''Unit-tests for the package i.e. __init__.py'''
try:
try:
from packaging.version import Version
class ParserTestPackage(unittest.TestCase):
'''Unit-tests for the package i.e. __init__.py'''
def test_version(self):
from packaging.version import Version
'''Check if pymagglobal.__version__ conforms PEP 440'''
version = Version(pymagglobal.__version__)
except ImportError:
print("Skipped version test, as the packaging package is not available.")
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())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment