diff options
| author | Jelmer Vernooij <jelmer@jelmer.uk> | 2022-11-16 23:46:50 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 23:46:50 +0000 |
| commit | e613fd65a42bb1255ec2f43e3b36ce98040df454 (patch) | |
| tree | d51ac8c5e22eb98ad4666b0cd6a38285ce3f7ff9 /python/subunit/__init__.py | |
| parent | aee1c7963691f5523eb72060e53e4ca255a00566 (diff) | |
| parent | e52e3d10c409219479ccfd371f24e3b6d53b73b4 (diff) | |
| download | subunit-git-e613fd65a42bb1255ec2f43e3b36ce98040df454.tar.gz | |
Merge pull request #55 from testing-cabal/fix-test-lists
Fix reading of test lists
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 55b0e43..7318a29 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -1252,11 +1252,9 @@ def read_test_list(path): :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() + with open(path, 'r') as f: + return [line.split('#')[0].rstrip() for line in f.readlines() + if line.split('#')[0]] def make_stream_binary(stream): |
