@@ -134,3 +134,40 @@ def test_running_poetry_command_with_hooks(run_poetry, projects):
134
134
assert "THIS IS YOUR ENV!" in result .stdout
135
135
assert "THAT WAS YOUR ENV!" in result .stdout
136
136
# assert result.stderr == ""
137
+
138
+
139
+ @pytest .mark .slow ()
140
+ @pytest .mark .usefixtures ("_setup_poetry_project" )
141
+ def test_running_poetry_command_with_hooks_with_directory (run_poetry , projects ):
142
+ result = run_poetry (
143
+ ["--directory=" + str (projects ["poetry_plugin" ]), "env" , "info" ],
144
+ cwd = projects ["poetry_plugin" ].parent ,
145
+ )
146
+ assert "THIS IS YOUR ENV!" in result .stdout
147
+ assert "THAT WAS YOUR ENV!" in result .stdout
148
+ # assert result.stderr == ""
149
+
150
+
151
+ @pytest .mark .slow ()
152
+ @pytest .mark .usefixtures ("_setup_poetry_project" )
153
+ def test_task_with_cli_dependency_with_directory (run_poetry , projects , is_windows ):
154
+ result = run_poetry (
155
+ [
156
+ "--directory=" + str (projects ["poetry_plugin" ]),
157
+ "poe" ,
158
+ "cow-greet" ,
159
+ "yo yo yo" ,
160
+ ],
161
+ cwd = projects ["poetry_plugin" ].parent ,
162
+ )
163
+ if is_windows :
164
+ assert result .stdout .startswith ("Poe => cowpy 'yo yo yo'" )
165
+ assert "< yo yo yo >" in result .stdout
166
+ else :
167
+ # On POSIX cowpy expects notices its being called as a subprocess and tries
168
+ # unproductively to take input from stdin
169
+ assert result .stdout .startswith ("Poe => cowpy 'yo yo yo'" )
170
+ assert (
171
+ "< Cowacter, eyes:default, tongue:False, thoughts:False >" in result .stdout
172
+ )
173
+ # assert result.stderr == ""
0 commit comments