diff --git a/tests/test_console.py b/tests/test_console.py index d192717ae..3fd860158 100755 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -28,6 +28,8 @@ import sys import os import subprocess +import sysconfig +import platform try: # python2 @@ -81,18 +83,15 @@ def setUp(self): def run_test(self): if self.SHELL_OUT: # make sure its on the path - try: - subprocess.check_call( - [ - "which", sys.argv[0] - ], - stdout=subprocess.PIPE - ) - except subprocess.CalledProcessError: + console_script = os.path.join(sysconfig.get_path('scripts'), sys.argv[0]) + if platform.system() == 'Windows': + console_script += '.exe' + + if not os.path.exists(console_script): self.fail( - "Could not find '{}' on $PATH. Tests that explicitly shell" + "Could not find '{}'. Tests that explicitly shell" " out can be disabled by setting the environment variable " - "OTIO_DISABLE_SHELLOUT_TESTS.".format(sys.argv[0]) + "OTIO_DISABLE_SHELLOUT_TESTS.".format(console_script) ) # actually run the test (sys.argv is already populated correctly)