Skip to content

Commit 42e7456

Browse files
committed
Merged in RonnyPfannschmidt/pytest/regendoc-upgrade (pull request #303)
use regendoc normalization and regenerate docs
2 parents 33a7f03 + 43d27ec commit 42e7456

20 files changed

+573
-559
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Set of targets useful for development/release process
22
PYTHON = python2.7
33
PATH := $(PWD)/.env/bin:$(PATH)
4+
REGENDOC_ARGS := \
5+
--normalize "/={8,} (.*) ={8,}/======= \1 ========/" \
6+
--normalize "/_{8,} (.*) _{8,}/_______ \1 ________/" \
7+
--normalize "/in \d+.\d+ seconds/in 0.12 seconds/" \
8+
--normalize "@/tmp/pytest-\d+/@/tmp/pytest-NaN/@"
49

510
# prepare virtual python environment
611
.env:
@@ -16,10 +21,11 @@ clean:
1621

1722
# generate documentation
1823
docs: develop
19-
find doc/en -name '*.txt' -not -path 'doc/en/_build/*' | xargs .env/bin/regendoc
24+
find doc/en -name '*.txt' -not -path 'doc/en/_build/*' | xargs .env/bin/regendoc ${REGENDOC_ARGS}
2025
cd doc/en; make html
2126

2227
# upload documentation
2328
upload-docs: develop
24-
find doc/en -name '*.txt' -not -path 'doc/en/_build/*' | xargs .env/bin/regendoc --update
25-
cd doc/en; make install
29+
find doc/en -name '*.txt' -not -path 'doc/en/_build/*' | xargs .env/bin/regendoc ${REGENDOC_ARGS} --update
30+
#cd doc/en; make install
31+

doc/en/assert.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ to assert that your function returns a certain value. If this assertion fails
2525
you will see the return value of the function call::
2626

2727
$ py.test test_assert1.py
28-
=========================== test session starts ============================
29-
platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1
30-
rootdir: /tmp/doc-exec-87, inifile:
28+
======= test session starts ========
29+
platform linux2 -- Python 2.7.9, pytest-2.8.0.dev4, py-1.4.28, pluggy-0.3.0
30+
rootdir: $REGENDOC_TMPDIR, inifile:
3131
collected 1 items
3232

3333
test_assert1.py F
3434

35-
================================= FAILURES =================================
36-
______________________________ test_function _______________________________
35+
======= FAILURES ========
36+
_______ test_function ________
3737

3838
def test_function():
3939
> assert f() == 4
4040
E assert 3 == 4
4141
E + where 3 = f()
4242

4343
test_assert1.py:5: AssertionError
44-
========================= 1 failed in 0.01 seconds =========================
44+
======= 1 failed in 0.12 seconds ========
4545

4646
``pytest`` has support for showing the values of the most common subexpressions
4747
including calls, attributes, comparisons, and binary and unary
@@ -135,15 +135,15 @@ when it encounters comparisons. For example::
135135
if you run this module::
136136

137137
$ py.test test_assert2.py
138-
=========================== test session starts ============================
139-
platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1
140-
rootdir: /tmp/doc-exec-87, inifile:
138+
======= test session starts ========
139+
platform linux2 -- Python 2.7.9, pytest-2.8.0.dev4, py-1.4.28, pluggy-0.3.0
140+
rootdir: $REGENDOC_TMPDIR, inifile:
141141
collected 1 items
142142

143143
test_assert2.py F
144144

145-
================================= FAILURES =================================
146-
___________________________ test_set_comparison ____________________________
145+
======= FAILURES ========
146+
_______ test_set_comparison ________
147147

148148
def test_set_comparison():
149149
set1 = set("1308")
@@ -157,7 +157,7 @@ if you run this module::
157157
E Use -v to get the full diff
158158

159159
test_assert2.py:5: AssertionError
160-
========================= 1 failed in 0.01 seconds =========================
160+
======= 1 failed in 0.12 seconds ========
161161

162162
Special comparisons are done for a number of cases:
163163

@@ -202,8 +202,8 @@ the conftest file::
202202

203203
$ py.test -q test_foocompare.py
204204
F
205-
================================= FAILURES =================================
206-
_______________________________ test_compare _______________________________
205+
======= FAILURES ========
206+
_______ test_compare ________
207207

208208
def test_compare():
209209
f1 = Foo(1)
@@ -213,7 +213,7 @@ the conftest file::
213213
E vals: 1 != 2
214214

215215
test_foocompare.py:8: AssertionError
216-
1 failed in 0.01 seconds
216+
1 failed in 0.12 seconds
217217

218218
.. _assert-details:
219219
.. _`assert introspection`:

doc/en/builtin.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ You can ask for available builtin or project-custom
115115
directory. The returned object is a `py.path.local`_
116116
path object.
117117

118-
in 0.00 seconds
118+
in 0.12 seconds

doc/en/capture.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ and running this module will show you precisely the output
6363
of the failing function and hide the other one::
6464

6565
$ py.test
66-
=========================== test session starts ============================
67-
platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1
68-
rootdir: /tmp/doc-exec-90, inifile:
66+
======= test session starts ========
67+
platform linux2 -- Python 2.7.9, pytest-2.8.0.dev4, py-1.4.28, pluggy-0.3.0
68+
rootdir: $REGENDOC_TMPDIR, inifile:
6969
collected 2 items
7070

7171
test_module.py .F
7272

73-
================================= FAILURES =================================
74-
________________________________ test_func2 ________________________________
73+
======= FAILURES ========
74+
_______ test_func2 ________
7575

7676
def test_func2():
7777
> assert False
7878
E assert False
7979

8080
test_module.py:9: AssertionError
81-
-------------------------- Captured stdout setup ---------------------------
82-
setting up <function test_func2 at 0x7fa678d6eb70>
83-
==================== 1 failed, 1 passed in 0.01 seconds ====================
81+
---------------------------- Captured stdout setup -----------------------------
82+
setting up <function test_func2 at 0xdeadbeef>
83+
======= 1 failed, 1 passed in 0.12 seconds ========
8484

8585
Accessing captured output from a test function
8686
---------------------------------------------------

doc/en/doctest.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ and another like this::
4343
then you can just invoke ``py.test`` without command line options::
4444

4545
$ py.test
46-
=========================== test session starts ============================
47-
platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1
48-
rootdir: /tmp/doc-exec-96, inifile: pytest.ini
46+
======= test session starts ========
47+
platform linux2 -- Python 2.7.9, pytest-2.8.0.dev4, py-1.4.28, pluggy-0.3.0
48+
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
4949
collected 1 items
5050

5151
mymodule.py .
5252

53-
========================= 1 passed in 0.06 seconds =========================
53+
======= 1 passed in 0.12 seconds ========
5454

5555
It is possible to use fixtures using the ``getfixture`` helper::
5656

0 commit comments

Comments
 (0)