From 32f9f8df86abc6265a508534c59b4ef7d942ca48 Mon Sep 17 00:00:00 2001 From: jsbautista Date: Fri, 15 Nov 2024 14:10:14 -0500 Subject: [PATCH] Clean Code --- qtconsole/tests/test_history_widget.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/qtconsole/tests/test_history_widget.py b/qtconsole/tests/test_history_widget.py index e17212d6..a9d55c82 100644 --- a/qtconsole/tests/test_history_widget.py +++ b/qtconsole/tests/test_history_widget.py @@ -12,25 +12,6 @@ from . import no_display -class TemporaryDirectory(object): - """ - Context manager for tempfile.mkdtemp(). - This class is available in python +v3.2. - See: https://gist.github.com/cpelley/10e2eeaf60dacc7956bb - """ - - def __enter__(self): - self.dir_name = tempfile.mkdtemp() - return self.dir_name - - def __exit__(self, exc_type, exc_value, traceback): - shutil.rmtree(self.dir_name) - - -TemporaryDirectory = getattr(tempfile, 'TemporaryDirectory', - TemporaryDirectory) - - @pytest.mark.skipif(no_display, reason="Doesn't work without a display") class TestHistoryWidget(unittest.TestCase):