diff options
Diffstat (limited to 'python/subunit')
| -rw-r--r-- | python/subunit/__init__.py | 13 | ||||
| -rw-r--r-- | python/subunit/tests/test_details.py | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 9dc849a..368d3b2 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -1132,6 +1132,19 @@ def get_default_formatter(): return sys.stdout +def read_test_list(path): + """Read a list of test ids from a file on disk. + + :param path: Path to the file + :return: Sequence of test ids + """ + f = open(path, 'rb') + try: + return [l.rstrip("\n") for l in f.readlines()] + finally: + f.close() + + def _make_stream_binary(stream): """Ensure that a stream will be binary safe. See _make_binary_on_windows.""" if getattr(stream, 'fileno', None) is not None: diff --git a/python/subunit/tests/test_details.py b/python/subunit/tests/test_details.py index 41c3212..2fd1a66 100644 --- a/python/subunit/tests/test_details.py +++ b/python/subunit/tests/test_details.py @@ -14,7 +14,6 @@ # limitations under that license. # -from cStringIO import StringIO import unittest import subunit.tests |
