You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recommend you install [pytest](http://pytest.org/latest/) and [pytest-cache](http://pythonhosted.org/pytest-cache/). Pytest is a testing tool that will give you more flexibility over running your unit tests.
4
+
5
+
If you choose not to install pytest, you can still run tests individually:
4
6
5
7
```bash
6
8
$ cd exercism/python/bob
7
9
$ python bob_test.py
8
10
```
9
11
10
-
## Running Tests for All Exercises
12
+
### Installation
13
+
14
+
```bash
15
+
$ pip install pytest pytest-cache
16
+
```
11
17
12
-
Before running all the tests ensure you have pytest installed:
18
+
## Pytest Examples
19
+
20
+
####Run All Tests
13
21
14
22
```bash
15
-
$ pip install pytest
23
+
$ cd exercism/python/bob
24
+
$ py.test bob_test.py
16
25
```
17
-
After pytest is installed all tests can be executed with:
26
+
27
+
####Stop After First Failure
28
+
29
+
```bash
30
+
$ cd exercism/python/bob
31
+
$ py.test -x bob_test.py
32
+
```
33
+
34
+
####Failed Tests First
35
+
36
+
Pytest-cache remembers which tests failed, and can run those tests first.
37
+
38
+
```bash
39
+
$ cd exercism/python/bob
40
+
$ py.test --ff bob_test.py
41
+
```
42
+
43
+
### Recommended
44
+
45
+
We recommend you run this command while working on exercises.
46
+
47
+
```bash
48
+
$ cd exercism/python/bob
49
+
$ py.test -x --ff bob_test.py
50
+
```
51
+
52
+
### Running All Tests for All Exercises
18
53
19
54
```bash
20
55
$ cd exercism/python/
21
56
$ py.test
22
57
```
58
+
59
+
Read the [pytest documentation](http://pytest.org/latest/contents.html#toc) and [pytest-cache](http://pythonhosted.org/pytest-cache/) documentation to learn more.
0 commit comments