Skip to content

Commit

Permalink
Merge pull request #741 from akaihola/fix-setup.py-test
Browse files Browse the repository at this point in the history
Add `marshmallow` as a test requirement, and fix pytest setup
  • Loading branch information
timothycrosley committed Mar 19, 2019
2 parents b615fdc + d40e9cb commit fe1b10d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
1 change: 1 addition & 0 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Code Contributors
- Trevor Bekolay (@tbekolay)
- Elijah Wilson (@tizz98)
- Chelsea Dole (@chelseadole)
- Antti Kaihola (@akaihola)

Documenters
===================
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changelog
=========

### 2.4.4 - TBD
- Fix running tests using `python setup.py test`
- Documented the `multiple_files` example

### 2.4.3 [hotfix] - March 17, 2019
Expand Down
8 changes: 7 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ ignore = F401,F403,E502,E123,E127,E128,E303,E713,E111,E241,E302,E121,E261,W391,E
max-line-length = 120

[metadata]
license_file = LICENSE
license_file = LICENSE

[aliases]
test=pytest

[tool:pytest]
addopts = tests
22 changes: 3 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,11 @@
from os import path

from setuptools import Extension, setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
extra_kwargs = {'tests_require': ['pytest', 'mock']}

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
sys.exit(pytest.main())


MYDIR = path.abspath(os.path.dirname(__file__))
CYTHON = False
JYTHON = 'java' in sys.platform

cmdclass = {'test': PyTest}
ext_modules = []

try:
Expand Down Expand Up @@ -109,7 +93,8 @@ def list_modules(dirname):
packages=['hug'],
requires=['falcon', 'requests'],
install_requires=['falcon==1.4.1', 'requests'],
cmdclass=cmdclass,
setup_requires=['pytest-runner'],
tests_require=['pytest', 'mock', 'marshmallow'],
ext_modules=ext_modules,
python_requires=">=3.4",
keywords='Web, Python, Python3, Refactoring, REST, Framework, RPC',
Expand All @@ -126,6 +111,5 @@ def list_modules(dirname):
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities'
],
**PyTest.extra_kwargs
]
)

0 comments on commit fe1b10d

Please sign in to comment.