| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a1581af commit 8bec865
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,12 +4,7 @@ We recommend you install [pytest](http://pytest.org/en/latest/) and | |||
| 4 | 4 | [pytest-cache](http://pythonhosted.org/pytest-cache/). `pytest` is a testing | |
| 5 | 5 | tool that will give you more flexibility over running your unit tests. | |
| 6 | 6 | ||
| 7 | - If you want to install `pytest` for Python 2, then use `pip`. | ||
| 8 | - | ||
| 9 | - ```bash | ||
| 10 | - pip install pytest pytest-cache | ||
| 11 | - ``` | ||
| 12 | - If you instead want the version of `pytest` for Python 3, then use `pip3`. | ||
| 7 | + To install `pytest`, run the following command: | ||
| 13 | 8 | ||
| 14 | 9 | ```bash | |
| 15 | 10 | pip3 install pytest pytest-cache | |
@@ -19,23 +14,12 @@ If you get a `command not found` response from your system, you can find a | |||
| 19 | 14 | tutorial on how to install `pip` | |
| 20 | 15 | [here](https://pip.pypa.io/en/stable/installing/). | |
| 21 | 16 | ||
| 22 | - **Note:** Whichever version of `pytest` you install last will be the default one used whenever `pytest` is executed, regardless of whether you have installed both versions. | ||
| 23 | - | ||
| 24 | 17 | If you want to check what the default version of `pytest` being used is, run the following: | |
| 25 | 18 | ||
| 26 | 19 | ```bash | |
| 27 | 20 | pytest --version | |
| 28 | 21 | ``` | |
| 29 | 22 | ||
| 30 | - If you have either version of `pytest` installed and you want to specifically run one of the versions, you can run that version by using `python` with the `-m` flag. | ||
| 31 | - | ||
| 32 | - For example, you could run the Python 3 version of pytest like so: | ||
| 33 | - | ||
| 34 | - ```bash | ||
| 35 | - $ python3 -m pytest --version | ||
| 36 | - This is pytest version 3.2.3, imported from /usr/local/lib/python3.5/dist-packages/pytest.py | ||
| 37 | - ``` | ||
| 38 | - | ||
| 39 | 23 | If you choose not to install `pytest`, you can still run tests individually and | |
| 40 | 24 | skip the rest of this tutorial: | |
| 41 | 25 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments