Skip to content

Commit

Permalink
Try not muting stdout on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Aug 2, 2021
1 parent c0fc5e6 commit 56f13dc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from json import dumps
import io
from platform import system
import sys
from tempfile import mkstemp
import unittest
Expand All @@ -10,13 +11,15 @@
class TestMainEntryPoint(unittest.TestCase):

def setUp(self) -> None:
# mute stdout to avoid usage statement
suppress_text = io.StringIO()
sys.stdout = suppress_text
# mute stdout to avoid usage statement, but not on Windows
if system() != 'Windows':
suppress_text = io.StringIO()
sys.stdout = suppress_text

def tearDown(self) -> None:
# reset stdout here
sys.stdout = sys.__stdout__
if system() != 'Windows':
sys.stdout = sys.__stdout__

def test_main_function_not_enough_args(self):
sys.argv = ['ScriptName', 'Not Enough']
Expand Down

0 comments on commit 56f13dc

Please sign in to comment.