Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
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
18 changes: 17 additions & 1 deletion 18 Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,23 @@ def test_list_tests(self):
self.assertEqual(output.rstrip().splitlines(),
tests)

def test_list_cases(self):
# test --list-cases
code = textwrap.dedent("""
import unittest

class Tests(unittest.TestCase):
def test_method1(self):
pass
def test_method2(self):
pass
""")
testname = self.create_test(code=code)
all_methods = ['%s.Tests.test_method1' % testname,
'%s.Tests.test_method2' % testname]
output = self.run_tests('--list-cases', testname)
self.assertEqual(output.splitlines(), all_methods)

def test_crashed(self):
# Any code which causes a crash
code = 'import faulthandler; faulthandler._sigsegv()'
Expand All @@ -841,7 +858,6 @@ def parse_methods(self, output):
return [match.group(1) for match in regex.finditer(output)]

def test_matchfile(self):
# Any code which causes a crash
code = textwrap.dedent("""
import unittest

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.