Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(devex): drop redundant api-docs warnings snapshot test (#59503)

Julian Bez90ce0470e4ad
diff --git a/posthog/api/test/__snapshots__/test_api_docs.ambr b/posthog/api/test/__snapshots__/test_api_docs.ambr
deleted file mode 100644
index 9e32d0887ec4..000000000000
--- a/posthog/api/test/__snapshots__/test_api_docs.ambr
+++ /dev/null
@@ -1,6 +0,0 @@
-# serializer version: 1
-# name: TestAPIDocsSchema.test_api_docs_generation_warnings_snapshot
- list([
- '',
- ])
-# ---
diff --git a/posthog/api/test/test_api_docs.py b/posthog/api/test/test_api_docs.py
index 81a93310a17b..3f0cd9d5463b 100644
--- a/posthog/api/test/test_api_docs.py
+++ b/posthog/api/test/test_api_docs.py
@@ -1,16 +1,7 @@
-import re
-from pathlib import Path
-
-import pytest
from posthog.test.base import APIBaseTest
class TestAPIDocsSchema(APIBaseTest):
- @pytest.fixture(autouse=True)
- def inject_fixtures(self, capsys, snapshot):
- self._capsys = capsys
- self._snapshot = snapshot
-
def test_can_generate_api_docs_schema(self) -> None:
self.client.logout()
@@ -22,28 +13,6 @@ class TestAPIDocsSchema(APIBaseTest):
assert schema_response.headers.get("Content-Type") == "application/vnd.oai.openapi; charset=utf-8"
assert int(str(schema_response.headers.get("Content-Length"))) > 0
- def test_api_docs_generation_warnings_snapshot(self) -> None:
- """
- There are a little under 200 warning from API docs generation. Lets at least not add more.
- """
- self.client.logout()
-
- self.client.get("/api/schema/")
-
- # we log lots of warnings when generating the schema
- warnings = [self._normalize_warning_path(warning) for warning in self._capsys.readouterr().err.split("\n")]
- assert sorted(warnings) == self._snapshot
-
- @staticmethod
- def _normalize_warning_path(warning: str) -> str:
- repo_root = str(Path(__file__).resolve().parents[3])
- warning = warning.replace(repo_root, "/home/runner/work/posthog/posthog")
- return re.sub(
- r"^.*?/site-packages/",
- "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/",
- warning,
- )
-
def test_llm_prompt_schema_includes_search_and_prompt_name_path_param(self) -> None:
self.client.logout()