summaryrefslogtreecommitdiff
path: root/python/subunit/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/subunit/__init__.py')
-rw-r--r--python/subunit/__init__.py13
1 files changed, 13 insertions, 0 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: