Commit 0e7f011f authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Add exception for when packaging is not available.

parent 2c9b1262
......@@ -23,7 +23,6 @@
import unittest
from pathlib import Path
from packaging.version import Version
import pymagglobal
......@@ -34,10 +33,13 @@ from pymagglobal import *
class ParserTestPackage(unittest.TestCase):
'''Unit-tests for the package i.e. __init__.py'''
def test_version(self):
'''Check if pymagglobal.__version__ conforms PEP 440'''
version = Version(pymagglobal.__version__)
try:
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.")
def test_models(self):
'''Check if built-in model-files exist'''
......
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