@@ -64,7 +64,9 @@ def test_framework_metadata(
6464
6565
6666@pytest .mark .appmap_enabled
67- def test_app_can_read_body (client , events , monkeypatch ): # pylint: disable=unused-argument
67+ def test_app_can_read_body (
68+ client , events , monkeypatch
69+ ): # pylint: disable=unused-argument
6870 monkeypatch .setenv ("APPMAP_RECORD_REQUESTS" , "false" )
6971 response = client .post ("/echo" , json = {"test" : "json" })
7072 assert response .content == b'{"test": "json"}'
@@ -206,12 +208,15 @@ def test_middleware_reset(pytester, monkeypatch):
206208class TestRecordRequestsDjango (TestRecordRequests ):
207209 @staticmethod
208210 def server_start_thread (env_vars_str ):
211+ # Use appmap from our working copy, not the module installed by virtualenv. Add the init
212+ # directory so the sitecustomize.py file it contains will be loaded on startup. This
213+ # simulates a real installation.
209214 exec_cmd (
210215 """
211- # use appmap from our working copy, not the module installed by virtualenv
212- export PYTHONPATH=`pwd`
216+ export PYTHONPATH="$PWD"
213217
214218cd appmap/test/data/django/
219+ PYTHONPATH="$PYTHONPATH:$PWD/init"
215220"""
216221 + env_vars_str
217222 + """ APPMAP_OUTPUT_DIR=/tmp python manage.py runserver 127.0.0.1:"""
0 commit comments