Skip to content

Commit 256c84a

Browse files
committed
Added test extra requirements
1 parent 8f373cc commit 256c84a

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ before_install:
2222
install:
2323
- |
2424
if [ "$TEST_TYPE" = build ]; then
25-
pip install pytest pytest-cov pytest-benchmark coveralls six pytz iso8601
26-
pip install -e .
25+
pip install -e .[test]
2726
python setup.py develop
2827
elif [ "$TEST_TYPE" = lint ]; then
2928
pip install flake8

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,19 @@ If you want to learn even more, you can also check the following [examples](exam
7575
After cloning this repo, ensure dependencies are installed by running:
7676

7777
```sh
78-
python setup.py install
78+
pip install .[test]
7979
```
8080

8181
After developing, the full test suite can be evaluated by running:
8282

8383
```sh
84-
python setup.py test # Use --pytest-args="-v -s" for verbose mode
84+
py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode
85+
```
86+
87+
You can also run the benchmarks with:
88+
89+
```sh
90+
py.test graphene --benchmark-only
8591
```
8692

8793

README.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,19 @@ After cloning this repo, ensure dependencies are installed by running:
8989

9090
.. code:: sh
9191
92-
python setup.py install
92+
pip install .[test]
9393
9494
After developing, the full test suite can be evaluated by running:
9595

9696
.. code:: sh
9797
98-
python setup.py test # Use --pytest-args="-v -s" for verbose mode
98+
py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode
99+
100+
You can also run the benchmarks with:
101+
102+
.. code:: sh
103+
104+
py.test graphene --benchmark-only
99105
100106
Documentation
101107
~~~~~~~~~~~~~

setup.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ def run_tests(self):
3737
errno = pytest.main(self.pytest_args)
3838
sys.exit(errno)
3939

40+
tests_require = [
41+
'pytest>=2.7.2',
42+
'pytest-benchmark',
43+
'pytest-cov',
44+
'coveralls',
45+
'six',
46+
'mock',
47+
'pytz',
48+
'iso8601',
49+
]
50+
4051
setup(
4152
name='graphene',
4253
version=version,
@@ -74,14 +85,9 @@ def run_tests(self):
7485
'graphql-relay>=0.4.5',
7586
'promise>=1.0.1',
7687
],
77-
tests_require=[
78-
'pytest>=2.7.2',
79-
'pytest-benchmark',
80-
'mock',
81-
'pytz',
82-
'iso8601',
83-
],
88+
tests_require=tests_require,
8489
extras_require={
90+
'test': tests_require,
8591
'django': [
8692
'graphene-django',
8793
],

0 commit comments

Comments
 (0)