summaryrefslogtreecommitdiff
path: root/lib/subunit/python/testtools/utils.py
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-31 10:01:03 -0700
committerJeremy Allison <jra@samba.org>2010-03-31 10:01:03 -0700
commit2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61 (patch)
tree42f219978f7d07d8fa196cb9ebd9db7be971450d /lib/subunit/python/testtools/utils.py
parentf58d02dbeeeba037ee79fba93a707e959e90ffa3 (diff)
parent6f30b9a6ff57ca6112e6319c64c411d2bf09be79 (diff)
downloadsamba-2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61.tar.gz
samba-2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61.tar.bz2
samba-2e839a636b2ea3f4d8dfcf5a8e99d9725787ba61.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'lib/subunit/python/testtools/utils.py')
-rw-r--r--lib/subunit/python/testtools/utils.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/subunit/python/testtools/utils.py b/lib/subunit/python/testtools/utils.py
deleted file mode 100644
index c0845b610c..0000000000
--- a/lib/subunit/python/testtools/utils.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2008 Jonathan M. Lange. See LICENSE for details.
-
-"""Utilities for dealing with stuff in unittest."""
-
-
-import sys
-
-__metaclass__ = type
-__all__ = [
- 'iterate_tests',
- ]
-
-
-if sys.version_info > (3, 0):
- def _u(s):
- """Replacement for u'some string' in Python 3."""
- return s
- def _b(s):
- """A byte literal."""
- return s.encode("latin-1")
- advance_iterator = next
-else:
- def _u(s):
- return unicode(s, "latin-1")
- def _b(s):
- return s
- advance_iterator = lambda it: it.next()
-
-
-def iterate_tests(test_suite_or_case):
- """Iterate through all of the test cases in 'test_suite_or_case'."""
- try:
- suite = iter(test_suite_or_case)
- except TypeError:
- yield test_suite_or_case
- else:
- for test in suite:
- for subtest in iterate_tests(test):
- yield subtest