From ebb3c76b8800a9e99f7f33c8c0f87ce70dea00f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20P=2E=20Ren=C3=A9=20de=20Cotret?= Date: Wed, 2 Dec 2020 13:54:34 -0500 Subject: [PATCH] Revert "Future-proof test runner" This reverts commit ffa65c8495b837e8659fa4e88025bd546fb74172. --- tests/test_dataset.py | 3 +-- tests/test_plugins.py | 10 ++-------- tests/test_raw.py | 3 +-- tests/utils.py | 13 ------------- 4 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 tests/utils.py diff --git a/tests/test_dataset.py b/tests/test_dataset.py index a475ca8b..07e619a8 100644 --- a/tests/test_dataset.py +++ b/tests/test_dataset.py @@ -467,5 +467,4 @@ def tearDown(self): if __name__ == "__main__": - from utils import FutureProofTestRunner - unittest.main(testRunner=FutureProofTestRunner) + unittest.main() diff --git a/tests/test_plugins.py b/tests/test_plugins.py index b4058785..0cc81f29 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -2,9 +2,6 @@ import unittest from pathlib import Path from tempfile import gettempdir -from contextlib import redirect_stdout -import io - from iris import AbstractRawDataset, DiffractionDataset from iris.plugins import load_plugin @@ -48,11 +45,8 @@ def test_reduction(self): class TestBrokenPlugin(unittest.TestCase): def test_loading_broken_plugin(self): """ Test that exceptions are caught when loading a broken plug-in. """ - to_the_void = io.StringIO() - with redirect_stdout(to_the_void): - load_plugin(BROKEN_PLUGIN_PATH) + load_plugin(BROKEN_PLUGIN_PATH) if __name__ == "__main__": - from utils import FutureProofTestRunner - unittest.main(testRunner=FutureProofTestRunner) \ No newline at end of file + unittest.main() diff --git a/tests/test_raw.py b/tests/test_raw.py index 6d531ec0..2e66e9f4 100644 --- a/tests/test_raw.py +++ b/tests/test_raw.py @@ -71,5 +71,4 @@ def test_init_metadata(self): if __name__ == "__main__": - from utils import FutureProofTestRunner - unittest.main(testRunner=FutureProofTestRunner) + unittest.main() diff --git a/tests/utils.py b/tests/utils.py deleted file mode 100644 index 2c83a1a5..00000000 --- a/tests/utils.py +++ /dev/null @@ -1,13 +0,0 @@ -""" -Utility functions for tests -""" -import unittest -import warnings - -class FutureProofTestRunner(unittest.TextTestRunner): - """ - A test runner that raises errors on Deprecation warnings. - """ - def run(self, *args, **kwargs): - warnings.filterwarnings("error", category=DeprecationWarning) - return super().run(*args, **kwargs) \ No newline at end of file