File tree 2 files changed +20
-22
lines changed
2 files changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -24,31 +24,31 @@ An example of a simple test:
24
24
.. code-block :: python
25
25
26
26
# content of test_sample.py
27
- def func (x ):
27
+ def inc (x ):
28
28
return x + 1
29
29
30
30
def test_answer ():
31
- assert func (3 ) == 5
31
+ assert inc (3 ) == 5
32
32
33
33
34
34
To execute it::
35
35
36
36
$ pytest
37
- ======= test session starts ========
37
+ ============================= test session starts =============================
38
38
collected 1 items
39
39
40
40
test_sample.py F
41
41
42
- ======= FAILURES ========
43
- _______ test_answer ________
42
+ ================================== FAILURES =========================== ========
43
+ _________________________________ test_answer _________________________________
44
44
45
45
def test_answer():
46
- > assert func (3) == 5
46
+ > assert inc (3) == 5
47
47
E assert 4 == 5
48
- E + where 4 = func (3)
48
+ E + where 4 = inc (3)
49
49
50
50
test_sample.py:5: AssertionError
51
- ======= 1 failed in 0.12 seconds ========
51
+ ========================== 1 failed in 0.04 seconds =================== ========
52
52
53
53
54
54
Due to ``pytest ``'s detailed assertion introspection, only plain ``assert `` statements are used. See `getting-started <http://docs.pytest.org/en/latest/getting-started.html#our-first-test-run >`_ for more examples.
Original file line number Diff line number Diff line change @@ -14,33 +14,31 @@ An example of a simple test:
14
14
.. code-block :: python
15
15
16
16
# content of test_sample.py
17
- def func (x ):
17
+ def inc (x ):
18
18
return x + 1
19
19
20
20
def test_answer ():
21
- assert func (3 ) == 5
21
+ assert inc (3 ) == 5
22
22
23
23
24
24
To execute it::
25
25
26
26
$ pytest
27
- ======= test session starts ========
28
- platform linux -- Python 3.5.2, pytest-3.0.4, py-1.4.31, pluggy-0.4.0
29
- rootdir: $REGENDOC_TMPDIR, inifile:
27
+ ============================= test session starts =============================
30
28
collected 1 items
31
-
29
+
32
30
test_sample.py F
33
-
34
- ======= FAILURES ========
35
- _______ test_answer ________
36
-
31
+
32
+ ================================== FAILURES =========================== ========
33
+ _________________________________ test_answer _________________________________
34
+
37
35
def test_answer():
38
- > assert func (3) == 5
36
+ > assert inc (3) == 5
39
37
E assert 4 == 5
40
- E + where 4 = func (3)
41
-
38
+ E + where 4 = inc (3)
39
+
42
40
test_sample.py:5: AssertionError
43
- ======= 1 failed in 0.12 seconds ========
41
+ ========================== 1 failed in 0.04 seconds =================== ========
44
42
45
43
Due to ``pytest ``'s detailed assertion introspection, only plain ``assert `` statements are used.
46
44
See :ref: `Getting Started <getstarted >` for more examples.
You can’t perform that action at this time.
0 commit comments