Added test extra requirements

This commit is contained in:
Syrus Akbary 2017-02-07 21:54:50 -08:00
parent 8f373ccec3
commit 256c84a9a5
4 changed files with 30 additions and 13 deletions

View File

@ -22,8 +22,7 @@ before_install:
install: install:
- | - |
if [ "$TEST_TYPE" = build ]; then if [ "$TEST_TYPE" = build ]; then
pip install pytest pytest-cov pytest-benchmark coveralls six pytz iso8601 pip install -e .[test]
pip install -e .
python setup.py develop python setup.py develop
elif [ "$TEST_TYPE" = lint ]; then elif [ "$TEST_TYPE" = lint ]; then
pip install flake8 pip install flake8

View File

@ -75,13 +75,19 @@ If you want to learn even more, you can also check the following [examples](exam
After cloning this repo, ensure dependencies are installed by running: After cloning this repo, ensure dependencies are installed by running:
```sh ```sh
python setup.py install pip install .[test]
``` ```
After developing, the full test suite can be evaluated by running: After developing, the full test suite can be evaluated by running:
```sh ```sh
python setup.py test # Use --pytest-args="-v -s" for verbose mode py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode
```
You can also run the benchmarks with:
```sh
py.test graphene --benchmark-only
``` ```

View File

@ -89,13 +89,19 @@ After cloning this repo, ensure dependencies are installed by running:
.. code:: sh .. code:: sh
python setup.py install pip install .[test]
After developing, the full test suite can be evaluated by running: After developing, the full test suite can be evaluated by running:
.. code:: sh .. code:: sh
python setup.py test # Use --pytest-args="-v -s" for verbose mode py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode
You can also run the benchmarks with:
.. code:: sh
py.test graphene --benchmark-only
Documentation Documentation
~~~~~~~~~~~~~ ~~~~~~~~~~~~~

View File

@ -37,6 +37,17 @@ class PyTest(TestCommand):
errno = pytest.main(self.pytest_args) errno = pytest.main(self.pytest_args)
sys.exit(errno) sys.exit(errno)
tests_require = [
'pytest>=2.7.2',
'pytest-benchmark',
'pytest-cov',
'coveralls',
'six',
'mock',
'pytz',
'iso8601',
]
setup( setup(
name='graphene', name='graphene',
version=version, version=version,
@ -74,14 +85,9 @@ setup(
'graphql-relay>=0.4.5', 'graphql-relay>=0.4.5',
'promise>=1.0.1', 'promise>=1.0.1',
], ],
tests_require=[ tests_require=tests_require,
'pytest>=2.7.2',
'pytest-benchmark',
'mock',
'pytz',
'iso8601',
],
extras_require={ extras_require={
'test': tests_require,
'django': [ 'django': [
'graphene-django', 'graphene-django',
], ],