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
```
This commit is contained in:
Paul Gauthier 2023-05-17 16:13:01 -07:00
parent 2e53e59cf3
commit de69a3095a

View file

@ -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"))