From 3c19cfcd9aa515c2fc6b62104fccf9269cc2434e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 8 Jan 2016 22:19:37 -0200 Subject: [PATCH 01/13] Fix decode error in Python 2.7 when docstrings contain a non-ascii character Fix #628 --- CHANGELOG | 3 +++ _pytest/doctest.py | 14 +++++----- testing/test_doctest.py | 60 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4d62b18f5..3dba965eb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,9 @@ properly displayed. Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR. +- fix #628: fixed internal UnicodeDecodeError when doctests contain unicode. + Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR. + 2.8.5 ----- diff --git a/_pytest/doctest.py b/_pytest/doctest.py index fd4a24790..3052d0590 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -81,15 +81,15 @@ class DoctestItem(pytest.Item): reprlocation = ReprFileLocation(filename, lineno, message) checker = _get_unicode_checker() REPORT_UDIFF = doctest.REPORT_UDIFF - filelines = py.path.local(filename).readlines(cr=0) - lines = [] if lineno is not None: - i = max(test.lineno, max(0, lineno - 10)) # XXX? - for line in filelines[i:lineno]: - lines.append("%03d %s" % (i+1, line)) - i += 1 + lines = doctestfailure.test.docstring.splitlines(False) + # add line numbers to the left of the error message + lines = ["%03d %s" % (i + test.lineno + 1, x) + for (i, x) in enumerate(lines)] + # trim docstring error lines to 10 + lines = lines[example.lineno - 9:example.lineno + 1] else: - lines.append('EXAMPLE LOCATION UNKNOWN, not showing all tests of that example') + lines = ['EXAMPLE LOCATION UNKNOWN, not showing all tests of that example'] indent = '>>>' for line in example.source.splitlines(): lines.append('??? %s %s' % (indent, line)) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 88d90a7bf..0ac0b5f7e 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -1,3 +1,4 @@ +# encoding: utf-8 import sys from _pytest.doctest import DoctestItem, DoctestModule, DoctestTextfile import py @@ -109,6 +110,46 @@ class TestDoctests: "*UNEXPECTED*ZeroDivision*", ]) + def test_docstring_context_around_error(self, testdir): + """Test that we show some context before the actual line of a failing + doctest. + """ + testdir.makepyfile(''' + def foo(): + """ + text-line-1 + text-line-2 + text-line-3 + text-line-4 + text-line-5 + text-line-6 + text-line-7 + text-line-8 + text-line-9 + text-line-10 + text-line-11 + >>> 1 + 1 + 3 + + text-line-after + """ + ''') + result = testdir.runpytest('--doctest-modules') + result.stdout.fnmatch_lines([ + '*docstring_context_around_error*', + '005*text-line-3', + '006*text-line-4', + '013*text-line-11', + '014*>>> 1 + 1', + 'Expected:', + ' 3', + 'Got:', + ' 2', + ]) + # lines below should be trimmed out + assert 'text-line-2' not in result.stdout.str() + assert 'text-line-after' not in result.stdout.str() + def test_doctest_linedata_missing(self, testdir): testdir.tmpdir.join('hello.py').write(py.code.Source(""" class Fun(object): @@ -339,6 +380,23 @@ class TestDoctests: reprec = testdir.inline_run(p, "--doctest-glob=x*.txt") reprec.assertoutcome(failed=1, passed=0) + def test_contains_unicode(self, testdir): + """Fix internal error with docstrings containing non-ascii characters. + """ + testdir.makepyfile(u''' + # encoding: utf-8 + def foo(): + """ + >>> name = 'с' # not letter 'c' but instead Cyrillic 's'. + 'anything' + """ + ''') + result = testdir.runpytest('--doctest-modules') + result.stdout.fnmatch_lines([ + 'Got nothing', + '* 1 failed in*', + ]) + def test_ignore_import_errors_on_doctest(self, testdir): p = testdir.makepyfile(""" import asdf @@ -579,4 +637,4 @@ class TestDoctestAutoUseFixtures: """) result = testdir.runpytest('--doctest-modules') assert 'FAILURES' not in str(result.stdout.str()) - result.stdout.fnmatch_lines(['*=== 1 passed in *']) \ No newline at end of file + result.stdout.fnmatch_lines(['*=== 1 passed in *']) From f46de6880483a60e3295c2e02ce86c5b6485251c Mon Sep 17 00:00:00 2001 From: foxx Date: Fri, 8 Jan 2016 12:41:01 +0000 Subject: [PATCH 02/13] Fixes bug with stdout/stderr capture on pdb --- AUTHORS | 1 + _pytest/pdb.py | 4 +++- testing/test_pdb.py | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 3a2c3b39d..625e8535a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -73,3 +73,4 @@ Simon Gomizelj Russel Winder Ben Webb Alexei Kozlenok +Cal Leeming diff --git a/_pytest/pdb.py b/_pytest/pdb.py index 78fedd373..3269922c3 100644 --- a/_pytest/pdb.py +++ b/_pytest/pdb.py @@ -53,7 +53,9 @@ class PdbInvoke: def pytest_exception_interact(self, node, call, report): capman = node.config.pluginmanager.getplugin("capturemanager") if capman: - capman.suspendcapture(in_=True) + out, err = capman.suspendcapture(in_=True) + sys.stdout.write(out) + sys.stdout.write(err) _enter_pdb(node, call.excinfo, report) def pytest_internalerror(self, excrepr, excinfo): diff --git a/testing/test_pdb.py b/testing/test_pdb.py index a2fd4d43d..99acf3d79 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -75,6 +75,22 @@ class TestPDB: if child.isalive(): child.wait() + def test_pdb_interaction_capture(self, testdir): + p1 = testdir.makepyfile(""" + def test_1(): + print("getrekt") + assert False + """) + child = testdir.spawn_pytest("--pdb %s" % p1) + child.expect("getrekt") + child.expect("(Pdb)") + child.sendeof() + rest = child.read().decode("utf8") + assert "1 failed" in rest + assert "getrekt" not in rest + if child.isalive(): + child.wait() + def test_pdb_interaction_exception(self, testdir): p1 = testdir.makepyfile(""" import pytest From 8727503dd43c3775e4336c312d023c91149d1594 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 9 Jan 2016 11:44:35 -0200 Subject: [PATCH 03/13] Add CHANGELOG entry for #1223 --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 4d62b18f5..ee8587b70 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,10 @@ - fix #1292: monkeypatch calls (setattr, setenv, etc.) are now O(1). Thanks David R. MacIver for the report and Bruno Oliveira for the PR. +- fix #1223: captured stdout and stderr are now properly displayed before + entering pdb when ``--pdb`` is used instead of being thrown away. + Thanks Cal Leeming for the PR. + - fix #1305: pytest warnings emitted during ``pytest_terminal_summary`` are now properly displayed. Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR. From 5b29f579c5f85ac3613a06d46a86b69c21ef8718 Mon Sep 17 00:00:00 2001 From: Manu Phatak Date: Mon, 11 Jan 2016 00:11:46 -0600 Subject: [PATCH 04/13] update docs plugin.rst typo --- doc/en/plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/plugins.rst b/doc/en/plugins.rst index cac8a42c9..e9b3f460c 100644 --- a/doc/en/plugins.rst +++ b/doc/en/plugins.rst @@ -56,7 +56,7 @@ Here is a little annotated list for some popular plugins: check source code with pyflakes. * `oejskit `_: - a plugin to run javascript unittests in life browsers. + a plugin to run javascript unittests in live browsers. To see a complete list of all plugins with their latest testing status against different py.test and Python versions, please visit From ee75ecbda0ec123210bb8f18b0d06930299e6d91 Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Tue, 12 Jan 2016 17:01:34 -0800 Subject: [PATCH 05/13] Change `input` to `test_input` in docs for clarity Using `input` is confusing because it's also the name of a Python built-in function. So we use `test_input` instead. Fix #1321 --- doc/en/parametrize.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/en/parametrize.rst b/doc/en/parametrize.rst index c769d6f53..7d2ce39b7 100644 --- a/doc/en/parametrize.rst +++ b/doc/en/parametrize.rst @@ -41,15 +41,15 @@ to an expected output:: # content of test_expectation.py import pytest - @pytest.mark.parametrize("input,expected", [ + @pytest.mark.parametrize("test_input,expected", [ ("3+5", 8), ("2+4", 6), ("6*9", 42), ]) - def test_eval(input, expected): - assert eval(input) == expected + def test_eval(test_input, expected): + assert eval(test_input) == expected -Here, the ``@parametrize`` decorator defines three different ``(input,expected)`` +Here, the ``@parametrize`` decorator defines three different ``(test_input,expected)`` tuples so that the ``test_eval`` function will run three times using them in turn:: @@ -64,15 +64,15 @@ them in turn:: ======= FAILURES ======== _______ test_eval[6*9-42] ________ - input = '6*9', expected = 42 + test_input = '6*9', expected = 42 - @pytest.mark.parametrize("input,expected", [ + @pytest.mark.parametrize("test_input,expected", [ ("3+5", 8), ("2+4", 6), ("6*9", 42), ]) - def test_eval(input, expected): - > assert eval(input) == expected + def test_eval(test_input, expected): + > assert eval(test_input) == expected E assert 54 == 42 E + where 54 = eval('6*9') @@ -91,13 +91,13 @@ for example with the builtin ``mark.xfail``:: # content of test_expectation.py import pytest - @pytest.mark.parametrize("input,expected", [ + @pytest.mark.parametrize("test_input,expected", [ ("3+5", 8), ("2+4", 6), pytest.mark.xfail(("6*9", 42)), ]) - def test_eval(input, expected): - assert eval(input) == expected + def test_eval(test_input, expected): + assert eval(test_input) == expected Let's run this:: From 7b13c4bec0cdea33fd92a9c0b437b77d8537fc00 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 14 Jan 2016 21:01:07 -0200 Subject: [PATCH 06/13] Fix flakes --- _pytest/assertion/__init__.py | 4 ++-- _pytest/assertion/util.py | 7 +++---- _pytest/python.py | 10 ++++++---- _pytest/unittest.py | 7 ++++--- testing/test_assertinterpret.py | 2 +- tox.ini | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index 54742347c..865b33c8c 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -112,8 +112,8 @@ def pytest_runtest_setup(item): config=item.config, op=op, left=left, right=right) for new_expl in hook_result: if new_expl: - if (sum(len(p) for p in new_expl[1:]) > 80*8 - and item.config.option.verbose < 2): + if (sum(len(p) for p in new_expl[1:]) > 80*8 and + item.config.option.verbose < 2): show_max = 10 truncated_lines = len(new_expl) - show_max new_expl[show_max:] = [py.builtin._totext( diff --git a/_pytest/assertion/util.py b/_pytest/assertion/util.py index ca54f1692..401d04f10 100644 --- a/_pytest/assertion/util.py +++ b/_pytest/assertion/util.py @@ -140,8 +140,8 @@ def assertrepr_compare(config, op, left, right): summary = u('%s %s %s') % (ecu(left_repr), op, ecu(right_repr)) - issequence = lambda x: (isinstance(x, (list, tuple, Sequence)) - and not isinstance(x, basestring)) + issequence = lambda x: (isinstance(x, (list, tuple, Sequence)) and + not isinstance(x, basestring)) istext = lambda x: isinstance(x, basestring) isdict = lambda x: isinstance(x, dict) isset = lambda x: isinstance(x, (set, frozenset)) @@ -263,8 +263,7 @@ def _compare_eq_sequence(left, right, verbose=False): explanation += [ u('Right contains more items, first extra item: %s') % py.io.saferepr(right[len(left)],)] - return explanation # + _diff_text(pprint.pformat(left), - # pprint.pformat(right)) + return explanation def _compare_eq_set(left, right, verbose=False): diff --git a/_pytest/python.py b/_pytest/python.py index 926f503be..6f3a717af 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -416,8 +416,8 @@ class PyCollector(PyobjMixin, pytest.Collector): def istestfunction(self, obj, name): return ( - (self.funcnamefilter(name) or self.isnosetest(obj)) - and safe_getattr(obj, "__call__", False) and getfixturemarker(obj) is None + (self.funcnamefilter(name) or self.isnosetest(obj)) and + safe_getattr(obj, "__call__", False) and getfixturemarker(obj) is None ) def istestclass(self, obj, name): @@ -1765,8 +1765,10 @@ class FixtureLookupError(LookupError): stack.extend(map(lambda x: x.func, self.fixturestack)) msg = self.msg if msg is not None: - stack = stack[:-1] # the last fixture raise an error, let's present - # it at the requesting side + # the last fixture raise an error, let's present + # it at the requesting side + stack = stack[:-1] + for function in stack: fspath, lineno = getfslineno(function) try: diff --git a/_pytest/unittest.py b/_pytest/unittest.py index bb7579331..24fa9e921 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -24,9 +24,10 @@ def pytest_pycollect_makeitem(collector, name, obj): class UnitTestCase(pytest.Class): - nofuncargs = True # marker for fixturemanger.getfixtureinfo() - # to declare that our children do not support funcargs - # + # marker for fixturemanger.getfixtureinfo() + # to declare that our children do not support funcargs + nofuncargs = True + def setup(self): cls = self.obj if getattr(cls, '__unittest_skip__', False): diff --git a/testing/test_assertinterpret.py b/testing/test_assertinterpret.py index 209bdfd49..afbfbd9cb 100644 --- a/testing/test_assertinterpret.py +++ b/testing/test_assertinterpret.py @@ -203,7 +203,7 @@ class TestView: cls.View = pytest.importorskip("_pytest.assertion.oldinterpret").View def test_class_dispatch(self): - ### Use a custom class hierarchy with existing instances + # Use a custom class hierarchy with existing instances class Picklable(self.View): pass diff --git a/tox.ini b/tox.ini index 32336f20e..90468dbcf 100644 --- a/tox.ini +++ b/tox.ini @@ -155,4 +155,4 @@ norecursedirs = .tox ja .hg cx_freeze_source [flake8] -ignore =E401,E225,E261,E128,E124,E301,E302,E121,E303,W391,E501,E231,E126,E701,E265,E241,E251,E226,E101,W191,E131,E203,E122,E123,E271,E712,E222,E127,E125,E221,W292,E111,E113,E293,E262,W293,E129,E702,E201,E272,E202 +ignore =E401,E225,E261,E128,E124,E301,E302,E121,E303,W391,E501,E231,E126,E701,E265,E241,E251,E226,E101,W191,E131,E203,E122,E123,E271,E712,E222,E127,E125,E221,W292,E111,E113,E293,E262,W293,E129,E702,E201,E272,E202,E704,E731,E402 From 0caee1a67385e8cf59eab934b9ecb13d4d3e816a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Jan 2016 21:59:18 -0200 Subject: [PATCH 07/13] Add a few missing hooks to the docs --- doc/en/writing_plugins.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index b0522a3d0..0321b9402 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -485,12 +485,20 @@ Session related reporting hooks: .. autofunction:: pytest_itemcollected .. autofunction:: pytest_collectreport .. autofunction:: pytest_deselected +.. autofunction:: pytest_report_header +.. autofunction:: pytest_report_teststatus +.. autofunction:: pytest_terminal_summary And here is the central hook for reporting about test execution: .. autofunction:: pytest_runtest_logreport +You can also use this hook to customize assertion representation for some +types: + +.. autofunction:: pytest_assertrepr_compare + Debugging/Interaction hooks --------------------------- From 99072ea8c9caf1fd7ae56296b9848787d1947074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 20 Jan 2016 16:35:27 +0100 Subject: [PATCH 08/13] Fix practise -> practice typo in documentation --- README.rst | 2 +- doc/en/getting-started.rst | 2 +- doc/en/{goodpractises.rst => goodpractices.rst} | 2 +- doc/en/index.rst | 2 +- doc/en/overview.rst | 2 +- doc/en/writing_plugins.rst | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename doc/en/{goodpractises.rst => goodpractices.rst} (99%) diff --git a/README.rst b/README.rst index 34fad1660..6465bd756 100644 --- a/README.rst +++ b/README.rst @@ -60,7 +60,7 @@ Features - Detailed info on failing `assert statements `_ (no need to remember ``self.assert*`` names); - `Auto-discovery - `_ + `_ of test modules and functions; - `Modular fixtures `_ for diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index f91c38de9..a4814d196 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -193,7 +193,7 @@ Where to go next Here are a few suggestions where to go next: * :ref:`cmdline` for command line invocation examples -* :ref:`good practises ` for virtualenv, test layout, genscript support +* :ref:`good practices ` for virtualenv, test layout, genscript support * :ref:`fixtures` for providing a functional baseline to your tests * :ref:`apiref` for documentation and examples on using ``pytest`` * :ref:`plugins` managing and writing plugins diff --git a/doc/en/goodpractises.rst b/doc/en/goodpractices.rst similarity index 99% rename from doc/en/goodpractises.rst rename to doc/en/goodpractices.rst index b2c34bae9..2d8050bd9 100644 --- a/doc/en/goodpractises.rst +++ b/doc/en/goodpractices.rst @@ -1,5 +1,5 @@ .. highlightlang:: python -.. _`goodpractises`: +.. _`goodpractices`: Good Integration Practices ================================================= diff --git a/doc/en/index.rst b/doc/en/index.rst index 7fb80aaa2..09e342e22 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -40,7 +40,7 @@ pytest: helps you write better programs - multi-paradigm: pytest can run ``nose``, ``unittest`` and ``doctest`` style test suites, including running testcases made for Django and trial - - supports :ref:`good integration practises ` + - supports :ref:`good integration practices ` - supports extended :ref:`xUnit style setup ` - supports domain-specific :ref:`non-python tests` - supports generating `test coverage reports diff --git a/doc/en/overview.rst b/doc/en/overview.rst index 9d8390f52..eb2619775 100644 --- a/doc/en/overview.rst +++ b/doc/en/overview.rst @@ -7,7 +7,7 @@ Getting started basics getting-started usage - goodpractises + goodpractices projects faq diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 0321b9402..110ffd93b 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -95,7 +95,7 @@ Here is how you might run it:: python package directory (i.e. one containing an ``__init__.py``) then "import conftest" can be ambiguous because there might be other ``conftest.py`` files as well on your PYTHONPATH or ``sys.path``. - It is thus good practise for projects to either put ``conftest.py`` + It is thus good practice for projects to either put ``conftest.py`` under a package scope or to never import anything from a conftest.py file. From b28b3cc271fcd5bff672b62bf3ab9eacffabc1b1 Mon Sep 17 00:00:00 2001 From: Georgy Dyuldin Date: Wed, 20 Jan 2016 20:13:01 +0300 Subject: [PATCH 09/13] Add captured stdout to jUnit report on setup error --- _pytest/junitxml.py | 1 + testing/test_junitxml.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index 995694687..b0c2b4d3a 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -163,6 +163,7 @@ class _NodeReporter(object): def append_error(self, report): self._add_simple( Junit.error, "test setup failure", report.longrepr) + self._write_captured_output(report) def append_skipped(self, report): if hasattr(report, "wasxfail"): diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 0062ab135..e6db81051 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -419,6 +419,35 @@ class TestPython: systemout = pnode.find_first_by_tag("system-err") assert "hello-stderr" in systemout.toxml() + def test_setup_error_captures_stdout(self, testdir): + testdir.makepyfile(""" + def pytest_funcarg__arg(request): + print('hello-stdout') + raise ValueError() + def test_function(arg): + pass + """) + result, dom = runandparse(testdir) + node = dom.find_first_by_tag("testsuite") + pnode = node.find_first_by_tag("testcase") + systemout = pnode.find_first_by_tag("system-out") + assert "hello-stdout" in systemout.toxml() + + def test_setup_error_captures_stderr(self, testdir): + testdir.makepyfile(""" + import sys + def pytest_funcarg__arg(request): + sys.stderr.write('hello-stderr') + raise ValueError() + def test_function(arg): + pass + """) + result, dom = runandparse(testdir) + node = dom.find_first_by_tag("testsuite") + pnode = node.find_first_by_tag("testcase") + systemout = pnode.find_first_by_tag("system-err") + assert "hello-stderr" in systemout.toxml() + def test_mangle_testnames(): from _pytest.junitxml import mangle_testnames From dd56d7b7fca7cba45bc22fb4ff30a5a0a31c99ac Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 20 Jan 2016 19:00:52 -0200 Subject: [PATCH 10/13] Add CHANGELOG and AUTHORS entry for #1334 --- AUTHORS | 1 + CHANGELOG | 3 +++ 2 files changed, 4 insertions(+) diff --git a/AUTHORS b/AUTHORS index 625e8535a..7b22002d1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -35,6 +35,7 @@ Erik M. Bray Florian Bruhin Floris Bruynooghe Gabriel Reis +Georgy Dyuldin Graham Horler Grig Gheorghiu Guido Wesdorp diff --git a/CHANGELOG b/CHANGELOG index 6e3a73a49..3dd62dd22 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,6 +26,9 @@ - fix #628: fixed internal UnicodeDecodeError when doctests contain unicode. Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR. +- fix #1334: Add captured stdout to jUnit XML report on setup error. + Thanks Georgy Dyuldin for the PR. + 2.8.5 ----- From 82d00efa8dd4ef903f0eca2bd02fa1aab9ddbb96 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 21 Jan 2016 19:17:53 -0200 Subject: [PATCH 11/13] 2.8.6 release: version, CHANGELOG Remove note about expected failing envs in tox, as tox now supports skipping certain environments based on the platform. --- CHANGELOG | 4 +- HOWTORELEASE.rst | 4 -- _pytest/__init__.py | 2 +- doc/en/announce/index.rst | 1 + doc/en/announce/release-2.8.6.rst | 67 +++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 doc/en/announce/release-2.8.6.rst diff --git a/CHANGELOG b/CHANGELOG index 3dd62dd22..06f4ee741 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ -2.8.6.dev1 ----------- +2.8.6 +----- - fix #1259: allow for double nodeids in junitxml, this was a regression failing plugins combinations diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst index fd104722a..34c4564dd 100644 --- a/HOWTORELEASE.rst +++ b/HOWTORELEASE.rst @@ -27,10 +27,6 @@ Note: this assumes you have already registered on pypi. devpi list pytest or look at failures with "devpi list -f pytest". - There will be some failed environments like e.g. the py33-trial - or py27-pexpect tox environments on Win32 platforms - which is ok (tox does not support skipping on - per-platform basis yet). 7. Regenerate the docs examples using tox, and check for regressions:: diff --git a/_pytest/__init__.py b/_pytest/__init__.py index d9ec9eb3e..9b9c0c6ce 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.8.6.dev1' +__version__ = '2.8.6' diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index c0c6fbeca..1e1058cec 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-2.8.6 release-2.8.5 release-2.8.4 release-2.8.3 diff --git a/doc/en/announce/release-2.8.6.rst b/doc/en/announce/release-2.8.6.rst new file mode 100644 index 000000000..215fae51e --- /dev/null +++ b/doc/en/announce/release-2.8.6.rst @@ -0,0 +1,67 @@ +pytest-2.8.6 +============ + +pytest is a mature Python testing tool with more than a 1100 tests +against itself, passing on many different interpreters and platforms. +This release is supposed to be drop-in compatible to 2.8.5. + +See below for the changes and see docs at: + + http://pytest.org + +As usual, you can upgrade from pypi via:: + + pip install -U pytest + +Thanks to all who contributed to this release, among them: + + AMiT Kumar + Bruno Oliveira + Erik M. Bray + Florian Bruhin + Georgy Dyuldin + Jeff Widman + Kartik Singhal + Loïc Estève + Manu Phatak + Peter Demin + Rick van Hattem + Ronny Pfannschmidt + Ulrich Petri + foxx + + +Happy testing, +The py.test Development Team + + +2.8.6 (compared to 2.8.5) +------------------------- + +- fix #1259: allow for double nodeids in junitxml, + this was a regression failing plugins combinations + like pytest-pep8 + pytest-flakes + +- Workaround for exception that occurs in pyreadline when using + ``--pdb`` with standard I/O capture enabled. + Thanks Erik M. Bray for the PR. + +- fix #900: Better error message in case the target of a ``monkeypatch`` call + raises an ``ImportError``. + +- fix #1292: monkeypatch calls (setattr, setenv, etc.) are now O(1). + Thanks David R. MacIver for the report and Bruno Oliveira for the PR. + +- fix #1223: captured stdout and stderr are now properly displayed before + entering pdb when ``--pdb`` is used instead of being thrown away. + Thanks Cal Leeming for the PR. + +- fix #1305: pytest warnings emitted during ``pytest_terminal_summary`` are now + properly displayed. + Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR. + +- fix #628: fixed internal UnicodeDecodeError when doctests contain unicode. + Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR. + +- fix #1334: Add captured stdout to jUnit XML report on setup error. + Thanks Georgy Dyuldin for the PR. From 01793ed8bcabf11e921e6d30099ada9d4dc498e7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 22 Jan 2016 17:46:28 -0200 Subject: [PATCH 12/13] Use a full url to pytest logo on README So it appers correctly in PyPI --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6465bd756..2a4d7839f 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -.. image:: doc/en/img/pytest1.png +.. image:: http://pytest.org/latest/_static/pytest1.png :target: http://pytest.org :align: center :alt: pytest From b7de0401b84fca97671b3733ceff2fd30d984a1d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 22 Jan 2016 17:59:25 -0200 Subject: [PATCH 13/13] Bump version to 2.8.7.dev1 --- CHANGELOG | 4 ++++ _pytest/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 06f4ee741..e0f64a11b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2.8.7.dev1 +---------- + + 2.8.6 ----- diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 9b9c0c6ce..641025873 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.8.6' +__version__ = '2.8.7.dev1'