summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuhammad Kaisar Arkhan <yukiisbored@disroot.org>2017-12-30 04:45:05 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2017-12-30 10:20:05 +0100
commite9c3a20e099ee44d0873c1b73cb4300861cc9003 (patch)
treead34353f6f2196f9523c22f44611a1cad9aa3fac
parentAdd more tests to cover the basic translation of objects to strings. (diff)
downloadglucometerutils-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
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--setup.cfg15
-rw-r--r--setup.py22
-rw-r--r--test-requirements.txt4
4 files changed, 41 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 894b10a..70028ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/setup.py b/setup.py
index d7cc51f..c49745a 100644
--- a/setup.py
+++ b/setup.py
@@ -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