Skip to content

Commit

Permalink
beef up the doctest test for full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanCut committed Jan 12, 2022
1 parent 7c0f2e9 commit e75ce6a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions green/test/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,21 @@ def f():
dt = parser.get_doctest(test, {"f": f}, "doctest.name", "somefile.py", 20)
dt.__module__ = "somefile"
p = proto_test(doctest.DocTestCase(dt))
# no description
self.assertEqual(p.getDescription(0), "")
self.assertEqual(p.getDescription(1), "")
# short description
self.assertEqual(p.getDescription(2), "doctest.name")
# long description
description = p.getDescription(3)
self.assertIn("doctest.name", description)
self.assertIn("somefile.py", description)
self.assertIn("20", description)
# very long == long
description = p.getDescription(4)
self.assertIn("doctest.name", description)
self.assertIn("somefile.py", description)
self.assertIn("20", description)
# dotted name
self.assertEqual(p.dotted_name, "doctest.name")

Expand Down

0 comments on commit e75ce6a

Please sign in to comment.