diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0fb756b..18319e1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,4 +37,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | + python -m pip install -e . pytest diff --git a/tests/test_collectd_transmission.py b/tests/test_collectd_transmission.py index 654d182..f6fe861 100755 --- a/tests/test_collectd_transmission.py +++ b/tests/test_collectd_transmission.py @@ -11,13 +11,10 @@ # Monkey patching the collectd module to facilitate testing mock_collectd = mock.MagicMock() sys.modules['collectd'] = mock_collectd - -# This is a hack to force tests to use the in-repo version of the module and not -# the one installed by tox -sys.path.insert(0, '.') import collectd_transmission # pylint: disable=wrong-import-position + class MethodTestCase(unittest.TestCase): ''' Testing methods diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9ffd11c..0000000 --- a/tox.ini +++ /dev/null @@ -1,42 +0,0 @@ -[tox] -; flake8 includes both pep8 and pyflakes :] -envlist = py39,flake8,doc,coverage,pylint,pytest - -; -; test environnements -; -[testenv] -setenv = VIRTUAL_ENV={envdir} - LANG=en_US.UTF-8 - LANGUAGE=en_US:en - LC_ALL=C -passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH -install_command = pip install {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt -commands = python -m coverage run --parallel-mode --source collectd_transmission tests/test_collectd_transmission.py - -[testenv:flake8] -commands = flake8 collectd_transmission - -[testenv:coverage] -commands = python -m coverage combine - python -m coverage html - -[testenv:doc] -commands = python setup.py build_sphinx --builder html - python setup.py build_sphinx --builder text - -[testenv:pylint] -commands = pylint collectd_transmission/__init__.py tests/test_collectd_transmission.py - -[testenv:pytest] -commands = pytest - -; -; Commands configuration -; -[flake8] -; E501: line too long -exclude = .git,.venv,.tox,dist,doc,*.egg -show-source = true -ignore = E501