mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of tests.
This commit is contained in:
committed by
Mariusz Felisiak
parent
a2d5ea626e
commit
d8a4bcffdb
@@ -235,9 +235,13 @@ def setup_databases(
|
||||
return old_names
|
||||
|
||||
|
||||
def iter_test_cases(suite):
|
||||
"""Return an iterator over a test suite's unittest.TestCase objects."""
|
||||
for test in suite:
|
||||
def iter_test_cases(tests):
|
||||
"""
|
||||
Return an iterator over a test suite's unittest.TestCase objects.
|
||||
|
||||
The tests argument can also be an iterable of TestCase objects.
|
||||
"""
|
||||
for test in tests:
|
||||
if isinstance(test, TestCase):
|
||||
yield test
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user