Skip to content

Commit 042acf9

Browse files
authored
Merge pull request #192 from dan98765/update_readme_contributing_section
Rename the Development section to Contributing and sync it with the t…
2 parents 4d2f7e7 + 7483ffe commit 042acf9

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,37 @@ from graphql.execution.execute import execute
114114
execute(schema, ast, executor=SyncExecutor())
115115
```
116116

117-
### Development
117+
### Contributing
118118

119-
Install development and test dependencies:
119+
After cloning this repo, create a [virtualenv](https://virtualenv.pypa.io/en/stable/) and ensure dependencies are installed by running:
120120

121121
```sh
122+
virtualenv venv
123+
source venv/bin/activate
122124
pip install -e ".[test]"
123125
```
124126

125-
Run test suite:
127+
Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
126128

127129
```sh
128-
pytest
130+
py.test PATH/TO/MY/DIR/test_test.py # Single file
131+
py.test PATH/TO/MY/DIR/ # All tests in directory
129132
```
130133

134+
Add the `-s` flag if you have introduced breakpoints into the code for debugging.
135+
Add the `-v` ("verbose") flag to get more detailed test output. For even more detailed output, use `-vv`.
136+
Check out the [pytest documentation](https://docs.pytest.org/en/latest/) for more options and test running controls.
137+
138+
GraphQL-core 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:
139+
```sh
140+
tox
141+
```
142+
If you wish to run against a specific version defined in the `tox.ini` file:
143+
```sh
144+
tox -e py36
145+
```
146+
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 GraphQL-core even more stable & useful!
147+
131148
## Main Contributors
132149

133150
* [@syrusakbary](https://github.com/syrusakbary/)

0 commit comments

Comments
 (0)