Skip to content

Commit

Permalink
Remove unit tests that correspond to removed deprecated aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwardrop committed Dec 24, 2023
1 parent 28dca41 commit 9fe9e81
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
15 changes: 0 additions & 15 deletions tests/test_formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,6 @@ def test_terms(self, formula_expr):
"a:b:c",
]

@pytest.mark.filterwarnings(
r"ignore:`Formula\.terms` is deprecated.*:DeprecationWarning"
)
def test_terms_alias(self, formula_expr):
assert [str(t) for t in formula_expr.terms] == [
"1",
"a",
"b",
"c",
"a:b",
"a:c",
"b:c",
"a:b:c",
]

def test_ordering(self):
assert [str(t) for t in Formula("a+e:d+b:c+f")] == [
"1",
Expand Down
7 changes: 0 additions & 7 deletions tests/test_model_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def test_attributes(self, model_spec):
assert model_spec.materializer == "pandas"
assert (
model_spec.column_names
== model_spec.feature_names
== (
"Intercept",
"a",
Expand All @@ -69,7 +68,6 @@ def test_attributes(self, model_spec):
)
assert (
model_spec.column_indices
== model_spec.feature_indices
== {
"Intercept": 0,
"a": 1,
Expand Down Expand Up @@ -100,21 +98,16 @@ def test_attributes(self, model_spec):
assert model_spec.variables == {"a", "A"}
assert model_spec.variables_by_source == {"data": {"a", "A"}}

@pytest.mark.filterwarnings(
r"ignore:`ModelSpec\.feature_names` is deprecated.*:DeprecationWarning"
)
def test_get_model_matrix(self, model_spec, data2):
m = model_spec.get_model_matrix(data2)

assert isinstance(m, pandas.DataFrame)
assert model_spec.column_names == tuple(m.columns)
assert model_spec.feature_names == tuple(m.columns)

model_spec = model_spec.update(materializer=None)
m2 = model_spec.get_model_matrix(data2)
assert isinstance(m2, pandas.DataFrame)
assert model_spec.column_names == tuple(m2.columns)
assert model_spec.feature_names == tuple(m2.columns)

m3 = model_spec.get_model_matrix(data2, output="sparse")
assert isinstance(m3, scipy.sparse.spmatrix)
Expand Down

0 comments on commit 9fe9e81

Please sign in to comment.