Add __version__
parent
362c1c0715
commit
560acb20ea
@ -1 +1,2 @@
|
||||
from _quicktex import *
|
||||
from _quicktex import *
|
||||
from _quicktex import __version__
|
||||
|
@ -1,18 +0,0 @@
|
||||
import unittest
|
||||
import os.path
|
||||
|
||||
tests_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
class TestInstall(unittest.TestCase):
|
||||
"""Test if everything is installed correctly"""
|
||||
|
||||
def test_images(self):
|
||||
"""Test for the images submodule"""
|
||||
|
||||
images_path = os.path.join(tests_path, 'images')
|
||||
|
||||
assert os.path.isdir(images_path), 'images directory/submodule not present'
|
||||
assert os.path.isfile(os.path.join(images_path, '__init__.py')), 'images __init__.py not present, is the submodule checked out?'
|
||||
bp_size = os.path.getsize(os.path.join(images_path, 'Boilerplate.png'))
|
||||
assert bp_size == 955989, 'Boilerplate.png is the wrong size, is the submodule checked out with LFS enabled?'
|
@ -0,0 +1,34 @@
|
||||
"""Test if everything is installed correctly"""
|
||||
|
||||
import unittest
|
||||
import os.path
|
||||
import quicktex
|
||||
import nose
|
||||
|
||||
tests_path = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def test_images():
|
||||
"""Test for the images submodule"""
|
||||
|
||||
images_path = os.path.join(tests_path, 'images')
|
||||
|
||||
assert os.path.isdir(images_path), 'images directory/submodule not present'
|
||||
assert os.path.isfile(os.path.join(images_path, '__init__.py')), 'images __init__.py not present, is the submodule checked out?'
|
||||
bp_size = os.path.getsize(os.path.join(images_path, 'Boilerplate.png'))
|
||||
assert bp_size == 955989, 'Boilerplate.png is the wrong size, is the submodule checked out with LFS enabled?'
|
||||
|
||||
|
||||
def test_version():
|
||||
"""Test if the extension module version matches what setuptools returns"""
|
||||
try:
|
||||
from importlib import metadata
|
||||
except ImportError:
|
||||
# Python < 3.8, so we cant get the metadata, so just check if it exists
|
||||
assert quicktex.__version__
|
||||
print(f'Cannot check version in python < 3.8. __version__ is {quicktex.__version__}')
|
||||
return
|
||||
|
||||
version = metadata.version('quicktex')
|
||||
|
||||
assert version == quicktex.__version__, 'incorrect version string from extension module'
|
Loading…
Reference in New Issue