mirror of
https://github.com/PostHog/posthog.git
synced 2026-10-26 09:51:43 +08:00
41 lines
3.0 KiB
INI
41 lines
3.0 KiB
INI
[pytest]
|
|
pythonpath = . common tools/hogli-commands tools/query-performance-ai packages/personhog-proto
|
|
env =
|
|
DEBUG=1
|
|
TEST=1
|
|
DJANGO_SETTINGS_MODULE = posthog.settings
|
|
# Trunk flaky-test detection wants per-test file paths in junit XML; the default
|
|
# xunit2 family strips the file/line testcase attributes.
|
|
junit_family = xunit1
|
|
# --pytest-durations=0 disables the pytest-durations plugin by default; CI shard steps re-enable it explicitly
|
|
# -p no:tach disables tach's pytest plugin: without --tach it builds the full import graph (~5-10s
|
|
# per invocation) only to print a "could be skipped" hint. Opt back in with: pytest -p tach --tach
|
|
# -p no:langsmith_plugin skips the langsmith pytest plugin (auto-registered by a transitive dependency,
|
|
# ~0.8s of imports per invocation); nothing in this repo uses langsmith's pytest integration.
|
|
# Note: the pytest11 entry point name is "langsmith_plugin" (module langsmith.pytest_plugin), not
|
|
# "langsmith", so `-p no:langsmith` silently fails to match anything and the plugin still loads.
|
|
# -p no:faker skips faker's auto-registered pytest plugin (~75ms of imports per invocation);
|
|
# nothing in this repo uses the `faker` fixture or the library (faker is a transitive dep)
|
|
# -p pytest_boot_gc opens the boot GC window (gc.disable) before pytest-django runs
|
|
# django.setup(), which happens before conftest files load; the root conftest closes it
|
|
# -p no:unraisableexception -p no:threadexception: both plugins run gc_collect_harder()
|
|
# (several full gc.collect passes over the whole heap, seconds per session at our heap sizes)
|
|
# during cleanup to surface __del__/thread exceptions as warnings - but with -p no:warnings
|
|
# those warnings can never escalate to failures here, so the collections are pure teardown cost
|
|
addopts = -p no:warnings -p no:tach -p no:langsmith_plugin -p no:faker -p no:unraisableexception -p no:threadexception -p pytest_boot_gc --reuse-db --pytest-durations=0 --ignore=posthog/user_scripts --ignore=services/llm-gateway --ignore=services/stripe-mock --ignore=common/ingestion/acceptance_tests --ignore=tools/hogli --ignore=tools/hogli-commands --ignore=packages/owners-yaml --ignore=tools/traffic-sim --ignore=tools/query-performance-ai --ignore=products/desktop --ignore=products/stamphog/packages
|
|
|
|
markers =
|
|
ee
|
|
clickhouse_only
|
|
skip_on_multitenancy
|
|
async_migrations
|
|
requires_secrets: test needs internal secrets or infra and is skipped on external PRs
|
|
requires_vendor_credentials(*env_vars, check=None): test talks to a real cloud vendor; CI deselects it, local runs skip it unless every env var is set and check() passes
|
|
quarantine: applied automatically to tests quarantined via .test_quarantine.json (hogli test:quarantine)
|
|
persons_db_direct: test exercises the persons DB directly and must not have the personhog fake / ORM block active
|
|
covers_authentication(*classes): test authenticates a request through each authentication class; every class needs one such test
|
|
|
|
asyncio_mode = auto
|
|
asyncio_default_fixture_loop_scope = module
|
|
asyncio_default_test_loop_scope = module
|