Skip to content
Permalink
Browse files

Use pytest to run tests

Closes #34
  • Loading branch information...
yukiisbored authored and Flameeyes committed Dec 30, 2017
1 parent 1832178 commit e9c3a20e099ee44d0873c1b73cb4300861cc9003
Showing with 41 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +15 −0 setup.cfg
  3. +21 −1 setup.py
  4. +4 −0 test-requirements.txt
@@ -3,3 +3,4 @@
/MANIFEST
/dist/
__pycache__/
.cache
@@ -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 @@
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 @@
'glucometer=glucometerutils.glucometer:main'
]
},
cmdclass = {
'test': PyTestCommand,
},
)
@@ -0,0 +1,4 @@
absl-py
pytest
pytest-timeout
pyserial

0 comments on commit e9c3a20

Please sign in to comment.
You can’t perform that action at this time.