|
14 | 14 | class TestInit:
|
15 | 15 | """Tests for BaseTransformer.__init__()."""
|
16 | 16 |
|
17 |
| - def test_arguments(self): |
18 |
| - """Test that init has expected arguments.""" |
19 |
| - ta.functions.test_function_arguments( |
20 |
| - func=BaseTransformer.__init__, |
21 |
| - expected_arguments=["self", "columns", "copy", "verbose"], |
22 |
| - expected_default_values=(None, True, False), |
23 |
| - ) |
24 |
| - |
25 |
| - def test_default_attributes_set_in_init(self): |
26 |
| - """Test correct default values for attributes set in init.""" |
27 |
| - x = BaseTransformer() |
28 |
| - |
29 |
| - expected_attributes = { |
30 |
| - "version_": tubular._version.__version__, |
31 |
| - "verbose": False, |
32 |
| - "columns": None, |
33 |
| - "copy": True, |
34 |
| - } |
35 |
| - |
36 |
| - ta.classes.test_object_attributes( |
37 |
| - obj=x, |
38 |
| - expected_attributes=expected_attributes, |
39 |
| - msg="Default attributes set in init", |
40 |
| - ) |
41 |
| - |
42 | 17 | def test_attributes_set_from_passed_values(self):
|
43 | 18 | """Test attributes set from values passed in init have the correct values."""
|
44 | 19 | expected_attributes = {
|
@@ -67,30 +42,6 @@ def test_columns_str_to_list(self):
|
67 | 42 | msg="String put in list for columns",
|
68 | 43 | )
|
69 | 44 |
|
70 |
| - def test_class_methods(self): |
71 |
| - """Test that BaseTransformer has fit and transform methods.""" |
72 |
| - x = BaseTransformer() |
73 |
| - |
74 |
| - ta.classes.test_object_method(obj=x, expected_method="fit", msg="fit") |
75 |
| - |
76 |
| - ta.classes.test_object_method( |
77 |
| - obj=x, |
78 |
| - expected_method="transform", |
79 |
| - msg="transform", |
80 |
| - ) |
81 |
| - |
82 |
| - ta.classes.test_object_method( |
83 |
| - obj=x, |
84 |
| - expected_method="columns_set_or_check", |
85 |
| - msg="columns_set_or_check", |
86 |
| - ) |
87 |
| - |
88 |
| - ta.classes.test_object_method( |
89 |
| - obj=x, |
90 |
| - expected_method="columns_check", |
91 |
| - msg="columns_check", |
92 |
| - ) |
93 |
| - |
94 | 45 | def test_verbose_non_bool_error(self):
|
95 | 46 | """Test an error is raised if verbose is not specified as a bool."""
|
96 | 47 | with pytest.raises(TypeError, match="BaseTransformer: verbose must be a bool"):
|
@@ -130,14 +81,6 @@ def test_columns_non_string_error(self):
|
130 | 81 | class TestFit:
|
131 | 82 | """Tests for BaseTransformer.fit()."""
|
132 | 83 |
|
133 |
| - def test_arguments(self): |
134 |
| - """Test that fit has expected arguments.""" |
135 |
| - ta.functions.test_function_arguments( |
136 |
| - func=BaseTransformer.fit, |
137 |
| - expected_arguments=["self", "X", "y"], |
138 |
| - expected_default_values=(None,), |
139 |
| - ) |
140 |
| - |
141 | 84 | def test_fit_returns_self(self):
|
142 | 85 | """Test fit returns self?."""
|
143 | 86 | df = d.create_df_1()
|
@@ -223,13 +166,6 @@ def test_unexpected_kwarg_error(self):
|
223 | 166 | class TestTransform:
|
224 | 167 | """Tests for BaseTransformer.transform()."""
|
225 | 168 |
|
226 |
| - def test_arguments(self): |
227 |
| - """Test that transform has expected arguments.""" |
228 |
| - ta.functions.test_function_arguments( |
229 |
| - func=BaseTransformer.transform, |
230 |
| - expected_arguments=["self", "X"], |
231 |
| - ) |
232 |
| - |
233 | 169 | def test_columns_check_called(self, mocker):
|
234 | 170 | """Test that self.columns_check is called during transform."""
|
235 | 171 | df = d.create_df_1()
|
@@ -305,13 +241,6 @@ def test_X_returned(self, df, expected):
|
305 | 241 | class TestColumnsCheck:
|
306 | 242 | """Tests for columns_check method."""
|
307 | 243 |
|
308 |
| - def test_arguments(self): |
309 |
| - """Test that columns_check has expected arguments.""" |
310 |
| - ta.functions.test_function_arguments( |
311 |
| - func=BaseTransformer.columns_check, |
312 |
| - expected_arguments=["self", "X"], |
313 |
| - ) |
314 |
| - |
315 | 244 | def test_non_pd_df_error(self):
|
316 | 245 | """Test an error is raised if X is not passed as a pd.DataFrame."""
|
317 | 246 | x = BaseTransformer(columns="a")
|
@@ -360,13 +289,6 @@ def test_columns_not_in_X_error(self):
|
360 | 289 | class TestColumnsSetOrCheck:
|
361 | 290 | """Tests for columns_set_or_check method."""
|
362 | 291 |
|
363 |
| - def test_arguments(self): |
364 |
| - """Test that columns_set_or_check has expected arguments.""" |
365 |
| - ta.functions.test_function_arguments( |
366 |
| - func=BaseTransformer.columns_set_or_check, |
367 |
| - expected_arguments=["self", "X"], |
368 |
| - ) |
369 |
| - |
370 | 292 | def test_non_pd_df_error(self):
|
371 | 293 | """Test an error is raised if X is not passed as a pd.DataFrame."""
|
372 | 294 | x = BaseTransformer(columns="a")
|
@@ -434,13 +356,6 @@ def test_check_is_fitted_call(self):
|
434 | 356 | class TestCombineXy:
|
435 | 357 | """Tests for the BaseTransformer._combine_X_y method."""
|
436 | 358 |
|
437 |
| - def test_arguments(self): |
438 |
| - """Test that columns_check has expected arguments.""" |
439 |
| - ta.functions.test_function_arguments( |
440 |
| - func=BaseTransformer._combine_X_y, |
441 |
| - expected_arguments=["self", "X", "y"], |
442 |
| - ) |
443 |
| - |
444 | 359 | def test_X_not_DataFrame_error(self):
|
445 | 360 | """Test an exception is raised if X is not a pd.DataFrame."""
|
446 | 361 | x = BaseTransformer(columns=["a"])
|
@@ -510,13 +425,6 @@ def test_output_same_indexes(self):
|
510 | 425 | class TestCheckWeightsColumn:
|
511 | 426 | "tests for check_weights_column method."
|
512 | 427 |
|
513 |
| - def test_arguments(self): |
514 |
| - """Test that columns_set_or_check has expected arguments.""" |
515 |
| - ta.functions.test_function_arguments( |
516 |
| - func=BaseTransformer.check_weights_column, |
517 |
| - expected_arguments=["X", "weights_column"], |
518 |
| - ) |
519 |
| - |
520 | 428 | def test_weight_not_in_X_error(self):
|
521 | 429 | """Test an error is raised if weight is not in X."""
|
522 | 430 | X = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
|
|
0 commit comments