Skip to content

Commit f13e54b

Browse files
dan98765jkimbo
authored andcommitted
Update contributing docs about using tox and sync tox pytest cmd with travis (#744)
* Update pytest command run by tox to match the command used by travis. Updated README contributing section with info about using tox to run tests. * Uppercase 'Graphene'
1 parent a7168ff commit f13e54b

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,32 @@ After cloning this repo, ensure dependencies are installed by running:
7979
pip install -e ".[test]"
8080
```
8181

82-
After developing, the full test suite can be evaluated by running:
82+
Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
8383

8484
```sh
85-
py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode
85+
py.test PATH/TO/MY/DIR/test_test.py # Single file
86+
py.test PATH/TO/MY/DIR/ # All tests in directory
8687
```
8788

89+
Add the `-s` flag if you have introduced breakpoints into the code for debugging.
90+
Add the `-v` ("verbose") flag to get more detailed test output. For even more detailed output, use `-vv`.
91+
Check out the [pytest documentation](https://docs.pytest.org/en/latest/) for more options and test running controls.
92+
8893
You can also run the benchmarks with:
8994

9095
```sh
9196
py.test graphene --benchmark-only
9297
```
9398

99+
Graphene supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each python version and run tests with that version. To run against all python versions defined in the `tox.ini` config file, just run:
100+
```sh
101+
tox
102+
```
103+
If you wish to run against a specific version defined in the `tox.ini` file:
104+
```sh
105+
tox -e py36
106+
```
107+
Tox can only use whatever versions of python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of python on their own system ahead of time. We appreciate opening issues and pull requests to make graphene even more stable & useful!
94108

95109
### Documentation
96110

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
import sphinx_graphene_theme
34

45
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ deps = .[test]
77
setenv =
88
PYTHONPATH = .:{envdir}
99
commands=
10-
py.test
10+
py.test --cov=graphene graphene examples
1111

1212
[testenv:pre-commit]
1313
basepython=python3.6

0 commit comments

Comments
 (0)