diff --git a/docs/changelog/2424.feature.rst b/docs/changelog/2424.feature.rst new file mode 100644 index 000000000..4dd122480 --- /dev/null +++ b/docs/changelog/2424.feature.rst @@ -0,0 +1 @@ +Change shell test activation command to be a list of commands. diff --git a/tests/unit/activation/conftest.py b/tests/unit/activation/conftest.py index d9e76d0cd..3b0bdb241 100644 --- a/tests/unit/activation/conftest.py +++ b/tests/unit/activation/conftest.py @@ -20,7 +20,7 @@ def __init__(self, of_class, session, cmd, activate_script, extension): self._invoke_script = [cmd] self.activate_script = activate_script self.extension = extension - self.activate_cmd = "source" + self.activate_cmd = ["source"] self.deactivate = "deactivate" self.pydoc_call = "pydoc -w pydoc_test" self.script_encoding = "utf-8" @@ -161,7 +161,7 @@ def print_prompt(self): return NotImplemented def activate_call(self, script): - cmd = self.quote(str(self.activate_cmd)) + cmd = " ".join([self.quote(str(cmd)) for cmd in self.activate_cmd]) scr = self.quote(str(script)) return f"{cmd} {scr}".strip() diff --git a/tests/unit/activation/test_nushell.py b/tests/unit/activation/test_nushell.py index a778d4975..377233eb2 100644 --- a/tests/unit/activation/test_nushell.py +++ b/tests/unit/activation/test_nushell.py @@ -18,4 +18,9 @@ def __init__(self, session): def print_prompt(self): return r"$env.VIRTUAL_PROMPT" + def activate_call(self, script): + cmd = " ".join([str(cmd) for cmd in self.activate_cmd]) + scr = self.quote(str(script)) + return f"{cmd} {scr}".strip() + activation_tester(Nushell)