Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify unit test
  • Loading branch information
akulakov committed Sep 26, 2021
commit b59ce9b1c8abdba972c5e2959f7974a5b26ecdfe
9 changes: 2 additions & 7 deletions Lib/test/test_doctest3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
import contextlib
import doctest

class Test(unittest.TestCase):
class TestDoctest(unittest.TestCase):
def test_syntax_error(self):
f = io.StringIO()
with contextlib.redirect_stdout(f):
try:
doctest.run_docstring_examples("""
>>> 1 1
""", globals())
except Exception as e:
print('!!!!!', str(e))
doctest.run_docstring_examples('>>> 1 1', globals())
self.assertIn('''
1 1
^^^
Expand Down