-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
When run test with docstring, FAILURE message indent is unexpected.
For example,
import unittest
class TestSome(unittest.TestCase):
def test_bar(self):
"""
This test fails.
"""
self.assertEqual(1, 3)
run above test with pytest, following message is shown.
def test_foo(self):
"""
This test fails.
"""
> self.assertEqual(1, 3)
E AssertionError: 1 != 3
But I expected message like below.
def test_foo(self):
"""
This test fails.
"""
> self.assertEqual(1, 3)
E AssertionError: 1 != 3
I found out the cause is probably tokenize.generate_tokens
. (It is used src/_pytest/_code/source.deindent
). However, I do not know how to fix it.
Version
- macOS 10.14
- Python: 3.6.5
- pytest: 3.8.1
Metadata
Metadata
Assignees
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressed