Skip to content

Instantly share code, notes, and snippets.

@schuster-rainer
Created January 28, 2016 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schuster-rainer/e6dff26cf44278cb134b to your computer and use it in GitHub Desktop.
Save schuster-rainer/e6dff26cf44278cb134b to your computer and use it in GitHub Desktop.
Execute PIPED command in behave acceptance test
from behave import *
from os.path import join
from subprocess import Popen
import os
@when(u'the requirements are generated for documentation')
def step_impl(context):
cmd = " ".join(["my_fictional_command",
"input1",
context.requirements_filename,
">",
context.output_filename,
])
print(cmd)
p = Popen(cmd, shell=True)
os.waitpid(p.pid, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment