From e3cea41dcd2fd42887fa69935f8cba3a53414041 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 2 Sep 2014 12:20:16 +0200 Subject: [PATCH] fix issue572 - python3 compat of tmpdir example in docs. --- CHANGELOG | 2 ++ doc/en/getting-started.txt | 18 +++++++++--------- doc/en/index.txt | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 840a79406..187c9e7b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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. diff --git a/doc/en/getting-started.txt b/doc/en/getting-started.txt index 55dce9881..327415618 100644 --- a/doc/en/getting-started.txt +++ b/doc/en/getting-started.txt @@ -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 = - + 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 diff --git a/doc/en/index.txt b/doc/en/index.txt index 551677d6f..756c4331a 100644 --- a/doc/en/index.txt +++ b/doc/en/index.txt @@ -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 ` and `PDF documentation `_