diff --git a/src/commands/annotate_and_test_runner.py b/src/commands/annotate_and_test_runner.py index 5d842a9..74544ad 100644 --- a/src/commands/annotate_and_test_runner.py +++ b/src/commands/annotate_and_test_runner.py @@ -80,25 +80,21 @@ def _get_test_command(self, test_path: str) -> str: test_path=test_path, ) else: + working_directory = PyRockSettings().TEST_CONFIG.WORKING_DIR.replace( + '\\', '\\\\' + ) + run_test_command = " ".join( + PyRockSettings().TEST_CONFIG.TEST_RUNNER_COMMAND + ).replace('\\', '\\\\') + if PyRockSettings().PYTHON_VIRTUAL_ENV_PATH.value: venv_path = PyRockSettings().PYTHON_VIRTUAL_ENV_PATH.value.replace( '\\', '\\\\' ) - working_directory = PyRockSettings().TEST_CONFIG.WORKING_DIR.replace( - '\\', '\\\\' - ) - run_test_command = " ".join( - PyRockSettings().TEST_CONFIG.TEST_RUNNER_COMMAND - ).replace('\\', '\\\\') - test_command = [ venv_path, '&&', 'cd', working_directory, '&&', run_test_command, test_path, 'deactivate' ] else: - run_test_command = " ".join( - PyRockSettings().TEST_CONFIG.TEST_RUNNER_COMMAND - ).replace('\\', '\\\\') - test_command = ['cd', working_directory, '&&', run_test_command, test_path] return test_command @@ -351,6 +347,8 @@ def run(self, view: View): PyRockConstants.RELATIVE_PACKAGE_ASSETS_DIR, "beaker.png" ) + if sublime.platform() == PyRockConstants.PLATFORM_WINDOWS: + test_gutter_icon_path = test_gutter_icon_path.replace('\\', '/') self.region_key = f"pyrock-gutter-icon-{self.view.id()}" diff --git a/src/settings.py b/src/settings.py index 3249dac..ef52f52 100644 --- a/src/settings.py +++ b/src/settings.py @@ -116,7 +116,7 @@ def _validate(self): self.WORKING_DIR = self._field_value.get("working_directory") if self.WORKING_DIR is None or (self.WORKING_DIR and not os.path.exists(self.WORKING_DIR)): raise InvalidTestConfig( - f"Invalid or not existing working directory {self.TEST_FRAMEWORK}" + f"Invalid or not existing working directory {self.WORKING_DIR}" ) self.TEST_RUNNER_COMMAND = self._field_value.get("test_runner_command")