|
1 | 1 | # Test methods with long descriptive names can omit docstrings |
2 | 2 | # pylint: disable=missing-docstring |
3 | 3 |
|
4 | | -import sys |
5 | | -import contextlib |
6 | 4 | import unittest |
7 | | -from unittest.mock import Mock |
8 | 5 | import numpy as np |
9 | 6 |
|
10 | 7 | from Orange.data import DiscreteVariable, ContinuousVariable, Domain |
@@ -337,23 +334,9 @@ def test_compute_CD(self): |
337 | 334 | cd = scoring.compute_CD(avranks, 30, test="bonferroni-dunn") |
338 | 335 | np.testing.assert_almost_equal(cd, 0.798) |
339 | 336 |
|
340 | | - @contextlib.contextmanager |
341 | | - def mock_module(name): |
342 | | - if not name in sys.modules: |
343 | | - try: |
344 | | - sys.modules[name] = Mock() |
345 | | - yield |
346 | | - finally: |
347 | | - del sys.modules[name] |
348 | | - else: |
349 | | - yield |
350 | | - |
351 | 337 | # Do what you will, just don't crash |
352 | | - with mock_module("matplotlib"), \ |
353 | | - mock_module("matplotlib.pyplot"), \ |
354 | | - mock_module("matplotlib.backends.backend_agg"): |
355 | | - scoring.graph_ranks(avranks, "abcd", cd) |
356 | | - scoring.graph_ranks(avranks, "abcd", cd, cdmethod=0) |
| 338 | + scoring.graph_ranks(avranks, "abcd", cd) |
| 339 | + scoring.graph_ranks(avranks, "abcd", cd, cdmethod=0) |
357 | 340 |
|
358 | 341 |
|
359 | 342 | class TestLogLoss(unittest.TestCase): |
|
0 commit comments