Skip to content

xmlrunner: Expose python docstrings as comments in the XML result file #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
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
tests: Added Python Docstring to test new support
  • Loading branch information
oliviermartin committed Feb 19, 2020
commit 3fe2e4b8e15c261f4042e5c7ee8ef5bc47aa28f2
9 changes: 9 additions & 0 deletions tests/django_example/app/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@
# Create your tests here.
class DummyTestCase(TestCase):
def test_pass(self):
"""Test Pass"""
pass

def test_negative_comment1(self):
"""Use a close comment XML tag -->"""
pass

def test_negative_comment2(self):
"""Check XML tag </testsuites>"""
pass
4 changes: 4 additions & 0 deletions tests/django_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ def _check_runner(self, runner):
test_ids = [test.id() for test in suite]
self.assertEqual(test_ids, [
'app2.tests.DummyTestCase.test_pass',
'app.tests.DummyTestCase.test_negative_comment1',
'app.tests.DummyTestCase.test_negative_comment2',
'app.tests.DummyTestCase.test_pass',
])
suite = runner.build_suite(test_labels=[])
test_ids = [test.id() for test in suite]
self.assertEqual(set(test_ids), set([
'app.tests.DummyTestCase.test_pass',
'app.tests.DummyTestCase.test_negative_comment1',
'app.tests.DummyTestCase.test_negative_comment2',
'app2.tests.DummyTestCase.test_pass',
]))

Expand Down