-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: make sure temporary files are pre-closed
Windows fails with a permission error if the temporary file is already opened. Fixes #501
- Loading branch information
1 parent
3aa509d
commit fe6eb35
Showing
3 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
import contextlib | ||
import os | ||
import tempfile | ||
|
||
|
||
DATATYPES_EDS = os.path.join(os.path.dirname(__file__), "datatypes.eds") | ||
SAMPLE_EDS = os.path.join(os.path.dirname(__file__), "sample.eds") | ||
|
||
|
||
@contextlib.contextmanager | ||
def tmp_file(*args, **kwds): | ||
with tempfile.NamedTemporaryFile(*args, **kwds) as tmp: | ||
tmp.close() | ||
yield tmp |