Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Jan 17, 2021
1 parent 612fcb1 commit f7f3f91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ script:
#- travis_wait 60 coverage run -m pytest tests/
- rm -rf tests/testout
- coverage run -m pytest tests/
#copy config file
- cp tests/test_files/pyrpipe_conf.yaml .
- coverage run -m pytest tests/
- coverage report --show-missing -i
after_success:
- coveralls
9 changes: 6 additions & 3 deletions pyrpipe/pyrpipe_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def parse_cmd(cmd):
return cmd

@dryable
def get_shell_output(cmd,verbose=None):
def get_shell_output(cmd,verbose=None,shell=False):
"""Function to run a shell command and return returncode, stdout and stderr
Currently (pyrpipe v 0.0.4) this function is called in
get_return_status(), get_program_version()
pyrpipe v0.0.5 onwards the get_shell_output function uses shell=True
pyrpipe v0.0.5 onwards the get_shell_output function allows shell=True
Parameters
Expand All @@ -114,12 +114,15 @@ def get_shell_output(cmd,verbose=None):
#not logging these commands
cmd=parse_cmd(cmd)
log_message=cmd
#command_name=cmd.split()[0]


starttime_str=time.strftime("%y-%m-%d %H:%M:%S", time.localtime(time.time()))
if verbose:
pu.print_notification("Start:"+starttime_str)
pu.print_blue("$ "+log_message)
try:
result = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,shell=True)
result = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,shell=shell)
stdout,stderr = result.communicate()
if stdout:
stdout=stdout.decode("utf-8")
Expand Down
3 changes: 3 additions & 0 deletions tests/test_files/pyrpipe_conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dry: True
threads: 1
force: True

0 comments on commit f7f3f91

Please sign in to comment.