Skip to content

Commit 503ce81

Browse files
committed
Fix test for Python 3.6
capture_output argument of subprocess.run was only introduced in Python 3.7, explicitly open a pipe to stderr instead for compatibility.
1 parent 8ea8bce commit 503ce81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ def test_time_cli(all_cmd_time, tmpdir):
6666

6767

6868
def test_err_cli():
69-
subp = subprocess.run('stagpy field', shell=True, capture_output=True)
69+
subp = subprocess.run('stagpy field', shell=True, stderr=subprocess.PIPE)
7070
reg = re.compile(br'^Oops!.*\nPlease.*\n\nNoParFileError.*$')
7171
assert reg.match(subp.stderr)

0 commit comments

Comments
 (0)