fix issue572 - python3 compat of tmpdir example in docs.
This commit is contained in:
parent
c0f091d540
commit
e3cea41dcd
|
@ -10,6 +10,8 @@ NEXT
|
|||
|
||||
- Fix example in monkeypatch documentation, thanks t-8ch.
|
||||
|
||||
- fix issue572: correct tmpdir doc example for python3.
|
||||
|
||||
- Do not mark as universal wheel because Python 2.6 is different from
|
||||
other builds due to the extra argparse dependency. Fixes issue566.
|
||||
Thanks sontek.
|
||||
|
|
|
@ -51,17 +51,17 @@ That's it. You can execute the test function now::
|
|||
=========================== test session starts ============================
|
||||
platform linux -- Python 3.4.0 -- py-1.4.23 -- pytest-2.6.1
|
||||
collected 1 items
|
||||
|
||||
|
||||
test_sample.py F
|
||||
|
||||
|
||||
================================= FAILURES =================================
|
||||
_______________________________ test_answer ________________________________
|
||||
|
||||
|
||||
def test_answer():
|
||||
> assert func(3) == 5
|
||||
E assert 4 == 5
|
||||
E + where 4 = func(3)
|
||||
|
||||
|
||||
test_sample.py:5: AssertionError
|
||||
========================= 1 failed in 0.01 seconds =========================
|
||||
|
||||
|
@ -126,14 +126,14 @@ run the module by passing its filename::
|
|||
.F
|
||||
================================= FAILURES =================================
|
||||
____________________________ TestClass.test_two ____________________________
|
||||
|
||||
|
||||
self = <test_class.TestClass object at 0x2ad4b005b710>
|
||||
|
||||
|
||||
def test_two(self):
|
||||
x = "hello"
|
||||
> assert hasattr(x, 'check')
|
||||
E assert hasattr('hello', 'check')
|
||||
|
||||
|
||||
test_class.py:8: AssertionError
|
||||
1 failed, 1 passed in 0.01 seconds
|
||||
|
||||
|
@ -151,7 +151,7 @@ resources, for example a unique temporary directory::
|
|||
|
||||
# content of test_tmpdir.py
|
||||
def test_needsfiles(tmpdir):
|
||||
print tmpdir
|
||||
print (tmpdir)
|
||||
assert 0
|
||||
|
||||
We list the name ``tmpdir`` in the test function signature and
|
||||
|
@ -159,7 +159,7 @@ We list the name ``tmpdir`` in the test function signature and
|
|||
before performing the test function call. Let's just run it::
|
||||
|
||||
$ py.test -q test_tmpdir.py
|
||||
|
||||
|
||||
================================== ERRORS ==================================
|
||||
_____________________ ERROR collecting test_tmpdir.py ______________________
|
||||
/home/hpk/p/pytest/.tox/regen/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
|
||||
|
|
|
@ -11,7 +11,7 @@ pytest: helps you write better programs
|
|||
|
||||
**a mature full-featured Python testing tool**
|
||||
|
||||
- runs on Posix/Windows, Python 2.5-3.4, PyPy and Jython-2.5.1
|
||||
- runs on Posix/Windows, Python 2.6-3.4, PyPy and (possibly still) Jython-2.5.1
|
||||
- **well tested** with more than a thousand tests against itself
|
||||
- **strict backward compatibility policy** for safe pytest upgrades
|
||||
- :ref:`comprehensive online <toc>` and `PDF documentation <pytest.pdf>`_
|
||||
|
|
Loading…
Reference in New Issue