Skip to content

Commit

Permalink
fix: make test for command line compatible with python 3.6
Browse files Browse the repository at this point in the history
Issue was with the subprocess package. I was using kw arguments that 
were introduced in 3.7, so I reverted the call to the 3.6 version, now 
it should run on both.
  • Loading branch information
ericbarefoot committed May 18, 2020
1 parent b5a19c2 commit 16470b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os
import shutil
import locale
import numpy as np
import subprocess

Expand All @@ -23,9 +24,10 @@ def test_version_call():
"""
test calling the command line feature to query the version.
"""
printed1 = subprocess.run(['run_pyDeltaRCM', '--version'], capture_output=True, text=True)
encoding = locale.getpreferredencoding()
printed1 = subprocess.run(['run_pyDeltaRCM', '--version'], stdout=subprocess.PIPE, encoding=encoding)
assert printed1.stdout == 'pyDeltaRCM ' + deltaModule.__version__ + '\n'
printed2 = subprocess.run(['python', '-m', 'pyDeltaRCM', '--version'], capture_output=True, text=True)
printed2 = subprocess.run(['python', '-m', 'pyDeltaRCM', '--version'], stdout=subprocess.PIPE, encoding=encoding)
assert printed2.stdout == 'pyDeltaRCM ' + deltaModule.__version__ + '\n'


Expand Down

0 comments on commit 16470b8

Please sign in to comment.