@@ -198,13 +198,27 @@ def test_python_bubblewrap_executes_resolved_interpreter(
198198 ):
199199 venv_bin = tmp_path / ".venv" / "bin"
200200 runtime_bin = tmp_path / "runtime" / "bin"
201+ site_dir = tmp_path / ".venv" / "lib" / "python3.14" / "site-packages"
202+ source_dir = tmp_path / "src" / "pkg"
201203 venv_bin .mkdir (parents = True )
202204 runtime_bin .mkdir (parents = True )
205+ site_dir .mkdir (parents = True )
206+ source_dir .mkdir (parents = True )
203207 runtime_python = runtime_bin / "python3.14"
204208 runtime_python .write_text ("" )
209+ (site_dir / "__editable__.example.pth" ).write_text (f"{ source_dir } \n " )
205210 venv_python = venv_bin / "python"
206211 venv_python .symlink_to (runtime_python )
207212 monkeypatch .setattr ("eaa_core.tool.coding.sys.executable" , str (venv_python ))
213+ monkeypatch .setattr (
214+ "eaa_core.tool.coding.site.getsitepackages" ,
215+ lambda : [str (site_dir )],
216+ )
217+ monkeypatch .setattr (
218+ "eaa_core.tool.coding.site.getusersitepackages" ,
219+ lambda : str (tmp_path / "missing-user-site" ),
220+ )
221+ monkeypatch .setattr ("eaa_core.tool.coding.sys.path" , [str (site_dir )])
208222 captured = {}
209223
210224 def fake_which (name , path = None ):
@@ -214,6 +228,7 @@ def fake_which(name, path=None):
214228
215229 def fake_run (command , ** kwargs ):
216230 captured ["command" ] = command
231+ captured ["env" ] = kwargs ["env" ]
217232 return subprocess .CompletedProcess (command , 0 , stdout = "ok\n " , stderr = "" )
218233
219234 monkeypatch .setattr ("eaa_core.tool.coding.shutil.which" , fake_which )
@@ -228,6 +243,9 @@ def fake_run(command, **kwargs):
228243 chdir_index = captured ["command" ].index ("--chdir" )
229244 python_command = captured ["command" ][chdir_index + 2 ]
230245 assert python_command == str (runtime_python )
246+ pythonpath = captured ["env" ]["PYTHONPATH" ].split (os .pathsep )
247+ assert str (site_dir ) in pythonpath
248+ assert str (source_dir ) in pythonpath
231249
232250
233251if __name__ == "__main__" :
0 commit comments