diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2021-03-09 23:12:44 -0800 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-11 09:23:33 +0100 |
commit | d8a4bcffdb116ca094d0da45ec4644f22133e02e (patch) | |
tree | b90be6aab5ab39ea1e7e45e00b4899cf36f26484 /django/test/utils.py | |
parent | a2d5ea626ec6aa4eab6b018c4bce58cb27e20676 (diff) | |
download | django-d8a4bcffdb116ca094d0da45ec4644f22133e02e.tar.gz |
Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of tests.
Diffstat (limited to 'django/test/utils.py')
-rw-r--r-- | django/test/utils.py | 10 |
1 files changed, 7 insertions, 3 deletions
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: |