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
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user