From 517d49828514553ea6a7c578e8966f442b066aba Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 5 Sep 2013 15:43:19 +0200 Subject: [PATCH] fix issue169: respect --tb=style with setup/teardown errors as well. --- CHANGELOG | 2 ++ testing/test_runner.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index be369bc06..912eab216 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -119,6 +119,8 @@ known incompatibilities: Changes between 2.3.4 and 2.3.5 ----------------------------------- +- fix issue169: respect --tb=style with setup/teardown errors as well. + - never consider a fixture function for test function collection - allow re-running of test items / helps to fix pytest-reruntests plugin diff --git a/testing/test_runner.py b/testing/test_runner.py index 984f382e3..fcd524f0c 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -483,3 +483,14 @@ def test_unicode_in_longrepr(testdir): assert result.ret == 1 assert "UnicodeEncodeError" not in result.stderr.str() + + +def test_failure_in_setup(testdir): + testdir.makepyfile(""" + def setup_module(): + 0/0 + def test_func(): + pass + """) + result = testdir.runpytest("--tb=line") + assert "def setup_module" not in result.stdout.str()