Skip to content

Commit

Permalink
Suppressing test outputs to terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Apr 13, 2024
1 parent ad71e17 commit 84e0708
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_mepo_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def __mepo_status(self, saved_output):

def __mepo_restore_state(self):
os.chdir(self.__class__.fixture_dir)
sys.stdout = output = StringIO() # suppress output
mepo_restore_state.run(args)
sys.stdout == sys.__stdout__
self.__mepo_status(self.__class__.output_clone_status)

def test_list(self):
Expand Down Expand Up @@ -134,7 +136,9 @@ def test_checkout_compare(self):
args.b = False
args.quiet = False
args.detach = False
sys.stdout = output = StringIO() # suppress output
mepo_checkout(args)
sys.stdout = sys.__stdout__
# Compare (default)
args.all = False
args.nocolor = True
Expand Down Expand Up @@ -282,7 +286,7 @@ def test_diff(self):
saved_output = self.__class__.__get_saved_output("output_diff.txt")
self.assertEqual(output.getvalue(), saved_output)
# Clean up
sp.run(f"git checkout {filename}".split())
sp.run(f"git checkout {filename}".split(), stderr=sp.DEVNULL)
self.__mepo_status(self.__class__.output_clone_status)

def test_whereis(self):
Expand Down

0 comments on commit 84e0708

Please sign in to comment.