diff mbox

[nft,2/2] tests: py: flush stdout on each test run

Message ID 1495802206-28856-2-git-send-email-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Pablo Neira Ayuso May 26, 2017, 12:36 p.m. UTC
Useful when redirecting output to file and tail -f it.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/py/nft-test.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 8d1df3bc517a..c1da71aaf827 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -955,6 +955,8 @@  def run_test_file(filename, force_all_family_option, specific_file):
     tests = passed = total_unit_run = total_warning = total_error = 0
 
     for lineno, line in enumerate(f):
+        sys.stdout.flush()
+
         if signal_received == 1:
             print "\nSignal received. Cleaning up and Exitting..."
             cleanup_on_exit()