Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion satpy/tests/reader_tests/test_vii_base_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def setUp(self, pgi_):
"""Set up the test."""
# Easiest way to test the reader is to create a test netCDF file on the fly
# uses a UUID to avoid permission conflicts during execution of tests in parallel
self.test_file_name = TEST_FILE + str(uuid.uuid1())
self.test_file_name = TEST_FILE + str(uuid.uuid1()) + ".nc"

with Dataset(self.test_file_name, 'w') as nc:
# Add global attributes
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/reader_tests/test_vii_l1b_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setUp(self):
"""Set up the test."""
# Easiest way to test the reader is to create a test netCDF file on the fly
# uses a UUID to avoid permission conflicts during execution of tests in parallel
self.test_file_name = TEST_FILE + str(uuid.uuid1())
self.test_file_name = TEST_FILE + str(uuid.uuid1()) + ".nc"

with Dataset(self.test_file_name, 'w') as nc:
# Create data group
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/reader_tests/test_vii_l2_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setUp(self):
"""Set up the test."""
# Easiest way to test the reader is to create a test netCDF file on the fly
# uses a UUID to avoid permission conflicts during execution of tests in parallel
self.test_file_name = TEST_FILE + str(uuid.uuid1())
self.test_file_name = TEST_FILE + str(uuid.uuid1()) + ".nc"

with Dataset(self.test_file_name, 'w') as nc:
# Create data group
Expand Down
5 changes: 3 additions & 2 deletions satpy/tests/writer_tests/test_cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
class TempFile(object):
"""A temporary filename class."""

def __init__(self):
def __init__(self, suffix=".nc"):
"""Initialize."""
self.filename = None
self.suffix = suffix

def __enter__(self):
"""Enter."""
self.handle, self.filename = tempfile.mkstemp()
self.handle, self.filename = tempfile.mkstemp(suffix=self.suffix)
os.close(self.handle)
return self.filename

Expand Down