|
5 | 5 | Tests for the graph module |
6 | 6 | """ |
7 | 7 |
|
8 | | -import warnings |
9 | | - |
10 | 8 | import pandas as pd |
11 | 9 | import scipy.sparse as sp |
12 | 10 |
|
@@ -174,34 +172,35 @@ def test_adjacency_matrix_deprecation_warning(): |
174 | 172 | n.add("Line", "line1", bus0="bus1", bus1="bus2") |
175 | 173 |
|
176 | 174 | # Check that calling without return_dataframe parameter raises FutureWarning |
177 | | - with warnings.catch_warnings(record=True) as w: |
178 | | - warnings.simplefilter("always") |
179 | | - adj = n.adjacency_matrix() |
| 175 | + # TODO: Activate when warnings are raised again |
| 176 | + # with warnings.catch_warnings(record=True) as w: |
| 177 | + # warnings.simplefilter("always") |
| 178 | + # adj = n.adjacency_matrix() |
180 | 179 |
|
181 | | - # Check that a warning was raised |
182 | | - assert len(w) == 1 |
183 | | - assert issubclass(w[0].category, FutureWarning) |
184 | | - assert "adjacency_matrix will return a pandas DataFrame by default" in str( |
185 | | - w[0].message |
186 | | - ) |
| 180 | + # # Check that a warning was raised |
| 181 | + # assert len(w) == 1 |
| 182 | + # assert issubclass(w[0].category, FutureWarning) |
| 183 | + # assert "adjacency_matrix will return a pandas DataFrame by default" in str( |
| 184 | + # w[0].message |
| 185 | + # ) |
187 | 186 |
|
188 | | - # Check that it still returns sparse matrix |
189 | | - assert isinstance(adj, sp.coo_matrix) |
| 187 | + # # Check that it still returns sparse matrix |
| 188 | + # assert isinstance(adj, sp.coo_matrix) |
190 | 189 |
|
191 | 190 | # Check that calling with explicit return_dataframe=False doesn't raise warning |
192 | | - with warnings.catch_warnings(record=True) as w: |
193 | | - warnings.simplefilter("always") |
194 | | - adj = n.adjacency_matrix(return_dataframe=False) |
| 191 | + # with warnings.catch_warnings(record=True) as w: |
| 192 | + # warnings.simplefilter("always") |
| 193 | + # adj = n.adjacency_matrix(return_dataframe=False) |
195 | 194 |
|
196 | | - # Check that no warning was raised |
197 | | - assert len(w) == 0 |
198 | | - assert isinstance(adj, sp.coo_matrix) |
| 195 | + # # Check that no warning was raised |
| 196 | + # assert len(w) == 0 |
| 197 | + # assert isinstance(adj, sp.coo_matrix) |
199 | 198 |
|
200 | 199 | # Check that calling with explicit return_dataframe=True doesn't raise warning |
201 | | - with warnings.catch_warnings(record=True) as w: |
202 | | - warnings.simplefilter("always") |
203 | | - adj = n.adjacency_matrix(return_dataframe=True) |
| 200 | + # with warnings.catch_warnings(record=True) as w: |
| 201 | + # warnings.simplefilter("always") |
| 202 | + # adj = n.adjacency_matrix(return_dataframe=True) |
204 | 203 |
|
205 | | - # Check that no warning was raised |
206 | | - assert len(w) == 0 |
207 | | - assert isinstance(adj, pd.DataFrame) |
| 204 | + # # Check that no warning was raised |
| 205 | + # assert len(w) == 0 |
| 206 | + # assert isinstance(adj, pd.DataFrame) |
0 commit comments