diff options
author | Daniel Hahler <git@thequod.de> | 2020-01-16 22:04:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 22:04:14 +0100 |
commit | 1667cf33505d2a0e018c16f86d77a2cfad683084 (patch) | |
tree | 3e67f4c45c65f468568d51579e6e02023b29dc7b /testing/test_terminal.py | |
parent | a4f5b8a4d6a4f65797ec9dc62f85a5869c3f3e06 (diff) | |
parent | fd1691a2b32cbcbc4341bf808877dc51936a74f5 (diff) | |
download | pytest-1667cf33505d2a0e018c16f86d77a2cfad683084.tar.gz |
Merge pull request #6384 from pv/showlocals-short
Make --showlocals work together with --tb=short
Fixes https://github.com/pytest-dev/pytest/issues/494
Ref: https://github.com/pytest-dev/pytest/issues/1715
Diffstat (limited to 'testing/test_terminal.py')
-rw-r--r-- | testing/test_terminal.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 98d7d96bc..66b22a8a7 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -670,6 +670,26 @@ class TestTerminalFunctional: ] ) + def test_showlocals_short(self, testdir): + p1 = testdir.makepyfile( + """ + def test_showlocals_short(): + x = 3 + y = "xxxx" + assert 0 + """ + ) + result = testdir.runpytest(p1, "-l", "--tb=short") + result.stdout.fnmatch_lines( + [ + "test_showlocals_short.py:*", + " assert 0", + "E assert 0", + " x = 3", + " y = 'xxxx'", + ] + ) + @pytest.fixture def verbose_testfile(self, testdir): return testdir.makepyfile( |