Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests where xarray was unable to guess backend engine #1592

Merged
merged 1 commit into from
Mar 10, 2021
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