Skip to content

Commit

Permalink
Decorate tests of deprecated functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrleeman committed Sep 27, 2018
1 parent 60c0fcc commit a1bab07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions metpy/io/tests/test_cdm.py
Expand Up @@ -6,8 +6,10 @@
import pytest

from metpy.io.cdm import Dataset
from metpy.testing import ignore_deprecation


@ignore_deprecation
def test_group():
"""Test `Group`/`Dataset` behavior."""
ds = Dataset()
Expand All @@ -25,6 +27,7 @@ def test_group():
'shape = 5\n\nAttributes:\n\tconventions: CF-1.5')


@ignore_deprecation
def test_dim():
"""Test `Dimension` behavior."""
ds = Dataset()
Expand All @@ -34,6 +37,7 @@ def test_dim():
assert str(dim) == "<class 'metpy.io.cdm.Dimension'>: name = x, size = 5"


@ignore_deprecation
def test_var():
"""Test `Variable` behavior."""
ds = Dataset()
Expand All @@ -58,6 +62,7 @@ def test_var():
'\n\tunits: meters\n\tshape = 2')


@ignore_deprecation
def test_multidim_var():
"""Test multi-dim `Variable`."""
ds = Dataset()
Expand All @@ -74,6 +79,7 @@ def test_multidim_var():
'\n\tshape = (2, 3)')


@ignore_deprecation
def test_remove_attr():
"""Test removing an attribute."""
ds = Dataset()
Expand All @@ -85,6 +91,7 @@ def test_remove_attr():
assert 'maker' not in ds.ncattrs()


@ignore_deprecation
def test_add_group():
"""Test adding a group."""
ds = Dataset()
Expand All @@ -95,6 +102,7 @@ def test_add_group():
assert str(ds) == 'root\nGroups:\nmyGroup'


@ignore_deprecation
def test_variable_size_check():
"""Test `Variable` checking size of passed array."""
ds = Dataset()
Expand Down
3 changes: 2 additions & 1 deletion metpy/io/tests/test_io_tools.py
Expand Up @@ -8,11 +8,12 @@

from metpy.io._tools import hexdump, UnitLinker
from metpy.io.cdm import Dataset
from metpy.testing import assert_array_equal
from metpy.testing import assert_array_equal, ignore_deprecation
from metpy.units import units


@pytest.fixture()
@ignore_deprecation
def test_var():
"""Fixture to create a dataset and variable for tests."""
ds = Dataset()
Expand Down

0 comments on commit a1bab07

Please sign in to comment.