diff options
author | Muhammad Kaisar Arkhan <yukiisbored@disroot.org> | 2017-12-30 04:45:05 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2017-12-30 10:20:05 +0100 |
commit | e9c3a20e099ee44d0873c1b73cb4300861cc9003 (patch) | |
tree | ad34353f6f2196f9523c22f44611a1cad9aa3fac | |
parent | Add more tests to cover the basic translation of objects to strings. (diff) | |
download | glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar.gz glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar.bz2 glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar.lz glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar.xz glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.tar.zst glucometerutils-e9c3a20e099ee44d0873c1b73cb4300861cc9003.zip |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | setup.cfg | 15 | ||||
-rw-r--r-- | setup.py | 22 | ||||
-rw-r--r-- | test-requirements.txt | 4 |
4 files changed, 41 insertions, 1 deletions
@@ -3,3 +3,4 @@ /MANIFEST /dist/ __pycache__/ +.cache diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..cd71828 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,15 @@ +[tool:pytest] +addopts = + --color=yes + --ignore=setup.py + --ignore=test-requirements.txt + -r a +norecursedirs = + .git + dist + build + venv + .env +testpaths = + test +timeout = 120 @@ -1,6 +1,23 @@ # -*- coding: utf-8 -*- +import sys + from setuptools import setup, find_packages +from setuptools.command.test import test as TestCommand + + +with open('test-requirements.txt') as requirements: + test_required = requirements.read().splitlines() + + +class PyTestCommand(TestCommand): + + def run_tests(self): + # import here, cause outside the eggs aren't loaded + import pytest + errno = pytest.main([]) + sys.exit(errno) + setup( name = 'glucometerutils', @@ -27,8 +44,8 @@ setup( data_files = [ ('lib/udev/rules', ['udev/69-glucometerutils.rules']), ], + tests_require = test_required, extras_require = { - 'test': ['absl-py'], # These are all the drivers' dependencies. Optional dependencies are # listed as mandatory for the feature. 'otultra2': ['pyserial'], @@ -46,4 +63,7 @@ setup( 'glucometer=glucometerutils.glucometer:main' ] }, + cmdclass = { + 'test': PyTestCommand, + }, ) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..9f7c85b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,4 @@ +absl-py +pytest +pytest-timeout +pyserial |