Flush stdout before subprocess.run
This commit adds sys.stdout.flush() before subprocess.run() in ansible_collection.py. Without this, the print statements are shown after the command output when building in mock.
This commit is contained in:
parent
5e5c534c32
commit
e3d150ec90
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue