Skip to content

Commit

Permalink
better open hygiene
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Jul 13, 2015
1 parent a6e248b commit 8abe07d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zope/testing/doctestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test4(self):
function. The decorated function is run before the test is executed.
This provides a way to provide some test-specfic setup, if desired.
Note that the docstring, of any, of the decorated function is ignored.
Note that the docstring, if any, of the decorated function is ignored.
Also note that, unlike regular unit tests, module globals from the
module defining the tests are't included in the test globals.
Expand Down Expand Up @@ -94,7 +94,8 @@ def __init__(self, test, optionflags=0, checker=None):
sys._getframe(2).f_globals['__file__']
))
path = os.path.join(base, test)
self.test = open(path).read()
with open(path) as f:
self.test = f.read()
self.name = os.path.basename(path)
self.path = path
else:
Expand Down

0 comments on commit 8abe07d

Please sign in to comment.