From d8a4bcffdb116ca094d0da45ec4644f22133e02e Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Tue, 9 Mar 2021 23:12:44 -0800 Subject: Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of tests. --- django/test/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'django/test/utils.py') diff --git a/django/test/utils.py b/django/test/utils.py index c1bfc87fc0..e977db8a10 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -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: -- cgit v1.3