From de69a3095ac48d305f377354cb9d1d21a138e2c1 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 17 May 2023 16:13:01 -0700 Subject: [PATCH] aider: Removed all the `save_stdin` stuff. # Context: USER: remove all the save_stdin stuff ASSISTANT: ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main([], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main([], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ``` ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main(["foo.txt"], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main(["foo.txt"], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ``` ```python tests/test_main.py <<<<<<< ORIGINAL save_stdin = sys.stdin sys.stdin = pipe_input main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) sys.stdin = save_stdin ======= main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) >>>>>>> UPDATED ``` --- tests/test_main.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/test_main.py b/tests/test_main.py index b9b93cb67..39baf0f56 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -14,20 +14,14 @@ class TestMain(TestCase): with tempfile.TemporaryDirectory() as temp_dir: os.chdir(temp_dir) pipe_input = create_input(StringIO('')) - save_stdin = sys.stdin - sys.stdin = pipe_input main([], input=pipe_input, output=DummyOutput()) - sys.stdin = save_stdin pipe_input.close() def test_main_with_empty_dir_new_file(self): with tempfile.TemporaryDirectory() as temp_dir: os.chdir(temp_dir) pipe_input = create_input(StringIO('')) - save_stdin = sys.stdin - sys.stdin = pipe_input main(["foo.txt"], input=pipe_input, output=DummyOutput()) - sys.stdin = save_stdin pipe_input.close() self.assertTrue(os.path.exists("foo.txt")) @@ -36,9 +30,6 @@ class TestMain(TestCase): os.chdir(temp_dir) subprocess.run(["git", "init"], cwd=temp_dir) pipe_input = create_input(StringIO('')) - save_stdin = sys.stdin - sys.stdin = pipe_input main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) - sys.stdin = save_stdin pipe_input.close() self.assertTrue(os.path.exists("foo.txt"))