We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea58d89 commit 2aed6b3Copy full SHA for 2aed6b3
bpython/test/test_repl.py
@@ -1,7 +1,6 @@
1
import collections
2
import inspect
3
import os
4
-import shutil
5
import socket
6
import sys
7
import tempfile
@@ -331,15 +330,11 @@ def setUp(self):
331
330
self.repl.config.editor = "true"
332
333
def test_create_config(self):
334
- tmp_dir = tempfile.mkdtemp()
335
- try:
+ with tempfile.TemporaryDirectory() as tmp_dir:
336
config_path = Path(tmp_dir) / "newdir" / "config"
337
self.repl.config.config_path = config_path
338
self.repl.edit_config()
339
self.assertTrue(os.path.exists(config_path))
340
- finally:
341
- shutil.rmtree(tmp_dir)
342
- self.assertFalse(os.path.exists(config_path))
343
344
345
class TestRepl(unittest.TestCase):
0 commit comments