From f0c840b2512cd2097aa5b597e6a4dcb7d5dbc7f8 Mon Sep 17 00:00:00 2001 From: Alex Groce Date: Fri, 13 Jul 2018 00:28:36 -0700 Subject: [PATCH] avoid IO timeout on the python test --- tests/test_basic_functionality.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test_basic_functionality.py b/tests/test_basic_functionality.py index 91cdc2e..42472c1 100644 --- a/tests/test_basic_functionality.py +++ b/tests/test_basic_functionality.py @@ -7,10 +7,23 @@ from unittest import TestCase class TestBasicFunctionality(TestCase): def test_basic_functionality(self): + outf = open("deepstate.out", 'w') + + class Unbuffered: + def __init__(self, stream): + self.stream = stream + + def write(self, data): + self.stream.write(data) + self.stream.flush() + outf.write(data) + deepstate = os.getenv("DEEPSTATE_CMD") with open("deepstate.out", 'w') as outf: - r = subprocess.call([deepstate, "build/examples/IntegerArithmetic"], stdout = outf, stderr = outf) + r = subprocess.call([deepstate, "build/examples/IntegerArithmetic"], + stdout = Unbuffered(sys.stdout), + stderr = Unbuffered(sys.stdout)) self.assertEqual(r, 0) with open("deepstate.out", 'r') as outf: