diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 4f6abc6f7d6fd93..6942ded1e6adc91 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -1527,8 +1527,10 @@ def test_open_file(self): outfile = support.TESTFN self.addCleanup(support.unlink, outfile) script = """if 1: - import sys + import sys, os sys.stdout.write("hello") + sys.stdout.flush() + os.fsync(sys.stdout.fileno()) """ file_actions = [ (os.POSIX_SPAWN_OPEN, 1, outfile,