Skip to content

Commit

Permalink
Fix version import (#81)
Browse files Browse the repository at this point in the history
* Update __init__.py

update version file import

* Update test_ufonormalizer.py

Check that package version is not the fallback value of "unknown".
  • Loading branch information
josh-hadley authored Dec 28, 2020
1 parent 89e6d4d commit 783ec14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ufonormalizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging

try:
from _version import __version__
from ._version import __version__
except ImportError:
try:
from setuptools_scm import get_version
Expand Down
5 changes: 5 additions & 0 deletions tests/test_ufonormalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,11 @@ def test_normalizeLibPlistWithBytesData(self):
Ny8wOS8yNiAwOToxMzoyMXEGc31xB2JzLg==
"""))

def test_version_not_unknown(self):
"""Test that package version is not 'unknown', which should only happen in cases
where the package has not been installed and is outside of source control. """
self.assertNotEqual(ufonormalizerVersion, 'unknown')


class XMLWriterTest(unittest.TestCase):
def __init__(self, methodName):
Expand Down

0 comments on commit 783ec14

Please sign in to comment.