File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -86,3 +86,19 @@ def test__is_venv_activated(
86
86
os .environ ["POETRY_ACTIVE" ] = poetry_active
87
87
88
88
assert tester .command ._is_venv_activated () is expected
89
+
90
+
91
+ def test_is_not_venv (tester : CommandTester , mocker : MockerFixture ) -> None :
92
+ shell_activate = mocker .patch ("poetry_plugin_shell.shell.Shell.activate" )
93
+ tester .command .env .is_venv = lambda : False
94
+
95
+ tester .execute ()
96
+ assert isinstance (tester .command , ShellCommand )
97
+ expected_output = (
98
+ f"The Python environment at { tester .command .env .path } "
99
+ "cannot be activated as it is not a virtural environment.\n "
100
+ )
101
+
102
+ shell_activate .assert_not_called ()
103
+ assert tester .io .fetch_error () == expected_output
104
+ assert tester .status_code == 1
You can’t perform that action at this time.
0 commit comments