Skip to content

Commit 28db2c0

Browse files
committed
Improved docs for running tests locally
1 parent 87f0c33 commit 28db2c0

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ before_install:
2222
install:
2323
- |
2424
if [ "$TEST_TYPE" = build ]; then
25-
pip install pytest==3.0.2 pytest-cov pytest-benchmark coveralls six pytest-django==2.9.1 mock django-filter
25+
pip install -e .[test]
26+
pip install psycopg2 # Required for Django postgres fields testing
2627
pip install django==$DJANGO_VERSION
27-
pip install -e .
2828
python setup.py develop
2929
elif [ "$TEST_TYPE" = lint ]; then
3030
pip install flake8

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ To learn more check out the following [examples](examples/):
9999
After cloning this repo, ensure dependencies are installed by running:
100100

101101
```sh
102-
python setup.py install
102+
pip install -e ".[test]"
103103
```
104104

105105
After developing, the full test suite can be evaluated by running:
106106

107107
```sh
108-
python setup.py test # Use --pytest-args="-v -s" for verbose mode
108+
py.test graphene_django --cov=graphene_django # Use -v -s for verbose mode
109109
```
110110

111111

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,21 @@ After cloning this repo, ensure dependencies are installed by running:
109109

110110
.. code:: sh
111111
112-
python setup.py install
112+
pip install -e ".[test]"
113113
114114
After developing, the full test suite can be evaluated by running:
115115

116116
.. code:: sh
117117
118-
python setup.py test # Use --pytest-args="-v -s" for verbose mode
118+
py.test graphene_django --cov=graphene_django # Use -v -s for verbose mode
119119
120120
Documentation
121121
~~~~~~~~~~~~~
122122

123-
The documentation can be generated using the excellent
123+
The documentation is generated using the excellent
124124
`Sphinx <http://www.sphinx-doc.org/>`__ and a custom theme.
125125

126-
To install the documentation dependencies, run the following:
126+
The documentation dependencies are installed by running:
127127

128128
.. code:: sh
129129

setup.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
from setuptools import find_packages, setup
22

3+
tests_require = [
4+
'pytest>=2.7.2',
5+
'pytest-cov',
6+
'coveralls',
7+
'mock',
8+
'pytz',
9+
'django-filter',
10+
'pytest-django==2.9.1',
11+
]
12+
313
setup(
414
name='graphene-django',
515
version='1.2.1',
@@ -41,14 +51,10 @@
4151
setup_requires=[
4252
'pytest-runner',
4353
],
44-
tests_require=[
45-
'django-filter>=1.0.0',
46-
'pytest',
47-
'pytest-django==2.9.1',
48-
'mock',
49-
# Required for Django postgres fields testing
50-
'psycopg2',
51-
],
54+
tests_require=tests_require,
55+
extras_require={
56+
'test': tests_require,
57+
},
5258
include_package_data=True,
5359
zip_safe=False,
5460
platforms='any',

0 commit comments

Comments
 (0)