Skip to content

Commit 783ec14

Browse files
authored
Fix version import (#81)
* Update __init__.py update version file import * Update test_ufonormalizer.py Check that package version is not the fallback value of "unknown".
1 parent 89e6d4d commit 783ec14

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ufonormalizer/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import logging
1717

1818
try:
19-
from _version import __version__
19+
from ._version import __version__
2020
except ImportError:
2121
try:
2222
from setuptools_scm import get_version

tests/test_ufonormalizer.py

+5
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,11 @@ def test_normalizeLibPlistWithBytesData(self):
15821582
Ny8wOS8yNiAwOToxMzoyMXEGc31xB2JzLg==
15831583
"""))
15841584

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

15861591
class XMLWriterTest(unittest.TestCase):
15871592
def __init__(self, methodName):

0 commit comments

Comments
 (0)