Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marshmallow as a test requirement, and fix pytest setup #741

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
]
)