diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-28 19:44:20 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-28 19:44:20 -0400 |
commit | 9453fa062539ac28b60c325e39c0fcbfd3b2ea10 (patch) | |
tree | be81d9b59be8c0c9a3b4a4ae59c047df2d332d8b /coverage/control.py | |
parent | f8455cc745ccbde7ee1cc13bd302a7bdc3369d6c (diff) | |
download | python-coveragepy-git-9453fa062539ac28b60c325e39c0fcbfd3b2ea10.tar.gz |
Pragmas for uncovered code
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/coverage/control.py b/coverage/control.py index fe4e5f15..b2ec64ab 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -550,10 +550,9 @@ class Coverage(object): # `save()` at the last minute so that the pid will be correct even # if the process forks. extra = "" - if _TEST_NAME_FILE: - f = open(_TEST_NAME_FILE) - test_name = f.read() - f.close() + if _TEST_NAME_FILE: # pragma: debugging + with open(_TEST_NAME_FILE) as f: + test_name = f.read() extra = "." + test_name data_suffix = "%s%s.%s.%06d" % ( socket.gethostname(), extra, os.getpid(), |