diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2011-04-25 22:44:33 +0200 |
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2011-04-25 22:44:33 +0200 |
| commit | 137f492db934863d0352e46aa00486b8f8d7c806 (patch) | |
| tree | 3b46eb95215bfac8aaba6203eec37e61f1728635 /python/subunit/__init__.py | |
| parent | 2950580814e220313b862e13ea40f3ac8163601c (diff) | |
| download | subunit-git-137f492db934863d0352e46aa00486b8f8d7c806.tar.gz | |
Move read_test_filter to python/subunit.
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 13 |
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: |
