summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-04-25 22:44:33 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-04-25 22:44:33 +0200
commit07eb3e594eb0bcb347ab86969b12235fde23dcaf (patch)
tree3b46eb95215bfac8aaba6203eec37e61f1728635 /python
parent124a94807c59b7e8dfebddd8a3491c5dae398ea4 (diff)
downloadsubunit-07eb3e594eb0bcb347ab86969b12235fde23dcaf.tar.gz
Move read_test_filter to python/subunit.
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py13
-rw-r--r--python/subunit/tests/test_details.py1
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