From 98dcd764bcd34718bfc6f2084a7b44a790339f89 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Thu, 14 Aug 2014 23:23:04 +0100 Subject: [PATCH] Depend on newer version of py This fixes issue560, a test for which is included here as well. --- CHANGELOG | 3 +++ setup.py | 2 +- testing/test_runner.py | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9ff564f85..1ccc87cc8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ NEXT - fixed issue561: adapt autouse fixture example for python3. +- fix issue560: correctly display code if an "else:" or "finally:" is + followed by statements on the same line. + 2.6.1 ----------------------------------- diff --git a/setup.py b/setup.py index 2c877151f..34b323459 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ long_description = open('README.rst').read() def main(): - install_requires = ['py>=1.4.22'] + install_requires = ['py>=1.4.24.dev1'] if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2): install_requires.append('argparse') if sys.platform == 'win32': diff --git a/testing/test_runner.py b/testing/test_runner.py index f9439ac2d..d341950e5 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -505,7 +505,6 @@ def test_unicode_in_longrepr(testdir): assert "UnicodeEncodeError" not in result.stderr.str() - def test_failure_in_setup(testdir): testdir.makepyfile(""" def setup_module(): @@ -515,3 +514,13 @@ def test_failure_in_setup(testdir): """) result = testdir.runpytest("--tb=line") assert "def setup_module" not in result.stdout.str() + + +def test_makereport_getsource(testdir): + testdir.makepyfile(""" + def test_foo(): + if False: pass + else: assert False + """) + result = testdir.runpytest() + assert 'INTERNALERROR' not in result.stdout.str()