appmap 2.0.8__tar.gz → 2.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {appmap-2.0.8 → appmap-2.0.10}/PKG-INFO +1 -1
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/env.py +28 -1
- appmap-2.0.10/_appmap/test/data/django/test/test_unittest_setup.py +11 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_django.py +6 -4
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/unittest.py +12 -0
- {appmap-2.0.8 → appmap-2.0.10}/pyproject.toml +1 -1
- {appmap-2.0.8 → appmap-2.0.10}/LICENSE +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/README.md +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/configuration.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/django.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/event.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/fastapi.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/flask.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/generation.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/importer.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/instrument.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/labels.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/metadata.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/noappmap.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/py_version_check.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/recorder.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/recording.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/remote_recording.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/singleton.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/appmap_test_base.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/bin/server_runner +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/conftest.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-all-paths-malformed.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-broken.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-class.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-empty-path.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-exclude-fn.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-func.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-malformed-path.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap-no-pyyaml.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap_testing/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/appmap_testing/django_simplelazyobject.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config/src/package/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config/test/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config/test/foo.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/.hide/hidden_mod/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/node_modules/node_mod/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/src/package/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/test/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/venv/venv_mod/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-up/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-up/project/p1/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-up/project/p2/sub1/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/djangoapp.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/hello_world.html +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/middleware.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/settings.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/settings_dev.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/djangoapp/urls.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/init/sitecustomize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/manage.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/pytest.ini +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/test/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/django/test/test_app.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/example_class.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/expected.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/fastapi/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/fastapi/fastapiapp/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/fastapi/fastapiapp/main.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/fastapi/init/sitecustomize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/fastapi/test_app.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/flask/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/flask/flaskapp.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/flask/init/sitecustomize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/flask/templates/test.html +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/flask/test_app.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/package1/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/package1/package2/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/package1/package2/__main__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/package1/package2/mod1.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/params.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/pytest.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_errored.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_failed.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_xfailed.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/simple.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/test_noappmap.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/test_simple.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/remote.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/.gitignore +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/expected/pytest.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/init/sitecustomize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/test/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/trial/test/test_deferred.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/appmap.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/pytest.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_errored.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_failed.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_xfailed.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_xsucceeded.metadata.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/unittest.appmap.json +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/init/sitecustomize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/simple/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/simple/test_noappmap.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/simple/test_simple.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/helpers.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/normalize.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_command.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_configuration.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_describe_value.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_django_simplelazyobject.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_env.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_events.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_fastapi.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_flask.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_generation.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_http.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_importer.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_labels.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_metadata.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_params.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_recording.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_runner.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_sqlalchemy.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_test_frameworks.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/test_util.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/test/web_framework.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/testing_framework.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/trace_logger.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/utils.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/_appmap/web_framework.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/command/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/command/appmap_agent_init.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/command/appmap_agent_status.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/command/appmap_agent_validate.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/command/runner.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/django.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/fastapi.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/flask.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/http.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/crypto.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/django.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/flask.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/formats.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/http.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/jobs.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/jwt.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/logger.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/labeling/random.yml +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/pytest.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/sqlalchemy.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/unittest.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap/uvicorn.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/appmap.pth +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/LICENSE +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/__init__.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/arguments.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/decorators.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/importer.py +0 -0
- {appmap-2.0.8 → appmap-2.0.10}/vendor/_appmap/wrapt/wrappers.py +0 -0
|
@@ -37,6 +37,7 @@ class Env(metaclass=SingletonMeta):
|
|
|
37
37
|
else:
|
|
38
38
|
self._env.pop(k, None)
|
|
39
39
|
|
|
40
|
+
self.log_file_creation_failed = False
|
|
40
41
|
self._configure_logging()
|
|
41
42
|
enabled = self._env.get("_APPMAP", "false")
|
|
42
43
|
self._enabled = enabled is None or enabled.lower() != "false"
|
|
@@ -133,6 +134,21 @@ class Env(metaclass=SingletonMeta):
|
|
|
133
134
|
def getLogger(self, name) -> trace_logger.TraceLogger:
|
|
134
135
|
return cast(trace_logger.TraceLogger, logging.getLogger(name))
|
|
135
136
|
|
|
137
|
+
def determine_log_file(self):
|
|
138
|
+
log_file = "appmap.log"
|
|
139
|
+
|
|
140
|
+
# Try creating the log file in the current directory
|
|
141
|
+
try:
|
|
142
|
+
with open(log_file, 'a', encoding='UTF8'):
|
|
143
|
+
pass
|
|
144
|
+
except IOError:
|
|
145
|
+
# The circumstances in which creation is going to fail
|
|
146
|
+
# are also those in which the user doesn't care whether
|
|
147
|
+
# there's a log file (e.g. when starting a REPL).
|
|
148
|
+
return None
|
|
149
|
+
return log_file
|
|
150
|
+
|
|
151
|
+
|
|
136
152
|
def _configure_logging(self):
|
|
137
153
|
trace_logger.install()
|
|
138
154
|
|
|
@@ -179,13 +195,19 @@ class Env(metaclass=SingletonMeta):
|
|
|
179
195
|
log_level = self.get("APPMAP_LOG_LEVEL", "info").upper()
|
|
180
196
|
loggers = config_dict["loggers"]
|
|
181
197
|
loggers["appmap"]["level"] = loggers["_appmap"]["level"] = log_level
|
|
198
|
+
|
|
199
|
+
log_file = self.determine_log_file()
|
|
200
|
+
# Use NullHandler if log_file is None to avoid complicating the configuration
|
|
201
|
+
# with the absence of the "default" handler.
|
|
182
202
|
config_dict["handlers"] = {
|
|
183
203
|
"default": {
|
|
184
204
|
"class": "logging.handlers.RotatingFileHandler",
|
|
185
205
|
"formatter": "default",
|
|
186
|
-
"filename":
|
|
206
|
+
"filename": log_file,
|
|
187
207
|
"maxBytes": 50 * 1024 * 1024,
|
|
188
208
|
"backupCount": 1,
|
|
209
|
+
} if log_file is not None else {
|
|
210
|
+
"class": "logging.NullHandler"
|
|
189
211
|
},
|
|
190
212
|
"stderr": {
|
|
191
213
|
"class": "logging.StreamHandler",
|
|
@@ -194,6 +216,7 @@ class Env(metaclass=SingletonMeta):
|
|
|
194
216
|
"stream": "ext://sys.stderr",
|
|
195
217
|
},
|
|
196
218
|
}
|
|
219
|
+
self.log_file_creation_failed = log_file is None
|
|
197
220
|
|
|
198
221
|
if log_config is not None:
|
|
199
222
|
name, level = log_config.split("=", 2)
|
|
@@ -213,3 +236,7 @@ def initialize(**kwargs):
|
|
|
213
236
|
Env.reset(**kwargs)
|
|
214
237
|
logger = logging.getLogger(__name__)
|
|
215
238
|
logger.info("appmap enabled: %s", Env.current.enabled)
|
|
239
|
+
if Env.current.log_file_creation_failed:
|
|
240
|
+
# Writing to stderr makes the REPL fail in vscode-python.
|
|
241
|
+
# https://github.com/microsoft/vscode-python/blob/c71c85ebf3749d5fac76899feefb21ee321a4b5b/src/client/common/process/rawProcessApis.ts#L268-L269
|
|
242
|
+
logger.info("appmap.log cannot be created")
|
|
@@ -201,11 +201,13 @@ class TestDjangoApp:
|
|
|
201
201
|
# To really check middleware reset, the tests must run in order,
|
|
202
202
|
# so disable randomly.
|
|
203
203
|
result = pytester.runpytest("-svv", "-p", "no:randomly")
|
|
204
|
-
result.assert_outcomes(passed=
|
|
204
|
+
result.assert_outcomes(passed=5, failed=0, errors=0)
|
|
205
205
|
# Look for the http_server_request event in test_app's appmap. If
|
|
206
206
|
# middleware reset is broken, it won't be there.
|
|
207
207
|
appmap_file = pytester.path / "tmp" / "appmap" / "pytest" / "test_request.appmap.json"
|
|
208
|
-
assert not os.path.exists(
|
|
208
|
+
assert not os.path.exists(
|
|
209
|
+
pytester.path / "tmp" / "appmap" / "requests"
|
|
210
|
+
), "django tests generated request recordings"
|
|
209
211
|
|
|
210
212
|
events = json.loads(appmap_file.read_text())["events"]
|
|
211
213
|
assert "http_server_request" in events[0]
|
|
@@ -213,7 +215,7 @@ class TestDjangoApp:
|
|
|
213
215
|
def test_disabled(self, pytester, monkeypatch):
|
|
214
216
|
monkeypatch.setenv("_APPMAP", "false")
|
|
215
217
|
result = pytester.runpytest("-svv", "-p", "no:randomly", "-k", "test_request")
|
|
216
|
-
result.assert_outcomes(passed=
|
|
218
|
+
result.assert_outcomes(passed=2, failed=0, errors=0)
|
|
217
219
|
assert not (pytester.path / "tmp").exists()
|
|
218
220
|
|
|
219
221
|
def test_disabled_for_process(self, pytester, monkeypatch):
|
|
@@ -223,7 +225,7 @@ class TestDjangoApp:
|
|
|
223
225
|
|
|
224
226
|
# There are two tests for remote recording. They should both fail,
|
|
225
227
|
# because process recording should disable remote recording.
|
|
226
|
-
result.assert_outcomes(passed=
|
|
228
|
+
result.assert_outcomes(passed=3, failed=2, errors=0)
|
|
227
229
|
|
|
228
230
|
assert (pytester.path / "tmp" / "appmap" / "process").exists()
|
|
229
231
|
assert not (pytester.path / "tmp" / "appmap" / "requests").exists()
|
|
@@ -3,6 +3,7 @@ import unittest
|
|
|
3
3
|
from contextlib import contextmanager
|
|
4
4
|
|
|
5
5
|
from _appmap import noappmap, testing_framework, wrapt
|
|
6
|
+
from _appmap.env import Env
|
|
6
7
|
from _appmap.utils import get_function_location
|
|
7
8
|
|
|
8
9
|
_session = testing_framework.session("unittest", "tests")
|
|
@@ -52,6 +53,17 @@ if sys.version_info[1] < 8:
|
|
|
52
53
|
yield
|
|
53
54
|
|
|
54
55
|
else:
|
|
56
|
+
# We need to disable request recording in TestCase._callSetUp too
|
|
57
|
+
# in order to prevent creation of a request recording besides test
|
|
58
|
+
# recording when requests are made inside setUp method.
|
|
59
|
+
# This edge case can be observed in this test in django project:
|
|
60
|
+
# $ APPMAP=TRUE ./runtests.py auth_tests.test_views.ChangelistTests.test_user_change_email
|
|
61
|
+
# (ChangelistTests.setUp makes a request)
|
|
62
|
+
@wrapt.patch_function_wrapper("unittest.case", "TestCase._callSetUp")
|
|
63
|
+
def callSetUp(wrapped, test_case, args, kwargs): # pylint: disable=unused-argument
|
|
64
|
+
with Env.current.disabled("requests"):
|
|
65
|
+
wrapped(*args, **kwargs)
|
|
66
|
+
|
|
55
67
|
# As of 3.8, unittest.case.TestCase now calls the test's method indirectly, through
|
|
56
68
|
# TestCase._callTestMethod. Hook that to manage a recording session.
|
|
57
69
|
@wrapt.patch_function_wrapper("unittest.case", "TestCase._callTestMethod")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/.hide/hidden_mod/__init__.py
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/config-exclude/node_modules/node_mod/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_errored.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_failed.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/pytest/expected/status_xfailed.metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_errored.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_failed.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_xfailed.metadata.json
RENAMED
|
File without changes
|
{appmap-2.0.8 → appmap-2.0.10}/_appmap/test/data/unittest/expected/status_xsucceeded.metadata.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|