Skip to content

Commit

Permalink
Remove pytest runner to run test (#714)
Browse files Browse the repository at this point in the history
This was the case already when running test manually but
not when running tox or travis
  • Loading branch information
sliverc authored and n2ygk committed Oct 3, 2019
1 parent 430ac15 commit b3cacb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion requirements-development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ pytest-factoryboy==2.0.3
recommonmark==0.6.0
Sphinx==2.2.0
sphinx_rtd_theme==0.4.3
twine==2.0.0
19 changes: 1 addition & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

from setuptools import setup

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
needs_sphinx = {'build_sphinx', 'upload_docs'}.intersection(sys.argv)
sphinx = ['sphinx'] if needs_sphinx else []
needs_wheel = {'bdist_wheel'}.intersection(sys.argv)
wheel = ['wheel'] if needs_wheel else []


def read(*paths):
"""
Expand Down Expand Up @@ -97,16 +90,6 @@ def get_package_data(package):
'djangorestframework>=3.10',
'django>=1.11',
],
setup_requires=pytest_runner + sphinx + wheel,
tests_require=[
'pytest-factoryboy',
'factory-boy',
'pytest-django',
'pytest',
'pytest-cov',
'django-polymorphic>=2.0',
'django-filter>=2.0',
'django-debug-toolbar==1.11'
],
python_requires=">=3.5",
zip_safe=False,
)
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ deps =
django22: Django>=2.2,<2.3
drf310: djangorestframework>=3.10.2,<3.11
drfmaster: https://github.com/encode/django-rest-framework/archive/master.zip
-rrequirements-development.txt

setenv =
PYTHONPATH = {toxinidir}
DJANGO_SETTINGS_MODULE=example.settings.test

commands =
python setup.py test --addopts '--cov --no-cov-on-fail --cov-report xml' {posargs}
pytest --cov --no-cov-on-fail --cov-report xml {posargs}

[testenv:flake8]
basepython = python3.6
deps =
-rrequirements-development.txt
commands = flake8

[testenv:sphinx]
basepython = python3.6
deps =
-rrequirements-development.txt
commands =
Expand Down

0 comments on commit b3cacb7

Please sign in to comment.