diff --git a/ansible_collection.py b/ansible_collection.py index 17c6777..70093be 100755 --- a/ansible_collection.py +++ b/ansible_collection.py @@ -70,6 +70,9 @@ class AnsibleCollection: ) print(f"Running: {args}") print() + # Without this, the print statements are shown after the command + # output when building in mock. + sys.stdout.flush() subprocess.run(args, check=True, cwd=self.collection_srcdir) print() @@ -90,6 +93,9 @@ class AnsibleCollection: args = ("ansible-test", "units", *extra_args) print(f"Running: {args}") print() + # Without this, the print statements are shown after the command + # output when building in mock. + sys.stdout.flush() subprocess.run(args, cwd=temppath, check=True)