Skip to content

Commit

Permalink
Clean Code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbautista committed Nov 15, 2024
1 parent fbf4541 commit 32f9f8d
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions qtconsole/tests/test_history_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 32f9f8d

Please sign in to comment.