Skip to content

Commit

Permalink
TST: fix roundtrip on /bin/sh (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebolyen authored Dec 20, 2023
1 parent fe911a1 commit 7cf7a7a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions q2cli/tests/test_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# ----------------------------------------------------------------------------

import os
import sys
import subprocess
import tempfile
import unittest
Expand Down Expand Up @@ -190,14 +191,20 @@ def test_round_trip(action, example):
use = CLIUsage(enable_assertions=True)
example_f(use)
rendered = use.render()
if sys.platform.startswith('linux'):
# TODO: remove me when arrays are not used in shell
extra = dict(executable='/bin/bash')
else:
extra = dict()
with tempfile.TemporaryDirectory() as tmpdir:
for ref, data in use.get_example_data():
data.save(os.path.join(tmpdir, ref))
subprocess.run([rendered],
subprocess.run(rendered,
shell=True,
check=True,
cwd=tmpdir,
env={**os.environ})
env={**os.environ},
**extra)


class ReplayResultCollectionTests(unittest.TestCase):
Expand Down

0 comments on commit 7cf7a7a

Please sign in to comment.