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:
- |
if [ "$TEST_TYPE" = build ]; then
pip install pytest pytest-cov pytest-benchmark coveralls six pytz iso8601
pip install -e .
pip install -e .[test]
python setup.py develop
elif [ "$TEST_TYPE" = lint ]; then
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:
```sh
python setup.py install
pip install .[test]
```
After developing, the full test suite can be evaluated by running:
```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
python setup.py install
pip install .[test]
After developing, the full test suite can be evaluated by running:
.. 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
~~~~~~~~~~~~~

View File

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