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 errors in the test suite due to pytest warning changes #1423

Merged
merged 3 commits into from
May 24, 2017
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
4 changes: 2 additions & 2 deletions xarray/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def assertWarns(self, message):
with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings('always', message)
yield
assert len(w) > 0
assert any(message in str(wi.message) for wi in w)
assert len(w) > 0
assert any(message in str(wi.message) for wi in w)

def assertVariableEqual(self, v1, v2):
assert_equal(v1, v2)
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ def test_to_dataset_whole(self):
self.assertDatasetIdentical(expected, actual)

expected = Dataset({'bar': ('x', [1, 2])})
with self.assertWarns('order of the arguments'):
with pytest.warns(FutureWarning):
actual = named.to_dataset('bar')
self.assertDatasetIdentical(expected, actual)

Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class Arbitrary(object):
self.assertDatasetIdentical(expected, actual)

def test_constructor_deprecated(self):
with self.assertWarns('deprecated'):
with pytest.warns(FutureWarning):
DataArray([1, 2, 3], coords={'x': [0, 1, 2]})

def test_constructor_auto_align(self):
Expand Down