Skip to content

Commit

Permalink
chore: update pytest (#16947)
Browse files Browse the repository at this point in the history
pauldambra authored Aug 10, 2023
1 parent d007b58 commit 48515cc
Showing 12 changed files with 31 additions and 715 deletions.
14 changes: 0 additions & 14 deletions ee/api/test/__snapshots__/test_organization_resource_access.ambr
Original file line number Diff line number Diff line change
@@ -117,20 +117,6 @@
LIMIT 100 /*controller='organization_resource_access-list',route='api/organizations/%28%3FP%3Cparent_lookup_organization_id%3E%5B%5E/.%5D%2B%29/resource_access/%3F%24'*/
'
---
# name: TestOrganizationResourceAccessAPI.test_list_organization_resource_access_is_not_nplus1.15
'
SELECT "ee_organizationresourceaccess"."id",
"ee_organizationresourceaccess"."resource",
"ee_organizationresourceaccess"."access_level",
"ee_organizationresourceaccess"."organization_id",
"ee_organizationresourceaccess"."created_by_id",
"ee_organizationresourceaccess"."created_at",
"ee_organizationresourceaccess"."updated_at"
FROM "ee_organizationresourceaccess"
WHERE "ee_organizationresourceaccess"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
LIMIT 100 /*controller='organization_resource_access-list',route='api/organizations/%28%3FP%3Cparent_lookup_organization_id%3E%5B%5E/.%5D%2B%29/resource_access/%3F%24'*/
'
---
# name: TestOrganizationResourceAccessAPI.test_list_organization_resource_access_is_not_nplus1.2
'
SELECT "posthog_organization"."id",
426 changes: 0 additions & 426 deletions ee/clickhouse/queries/test/__snapshots__/test_retention.ambr

Large diffs are not rendered by default.

77 changes: 0 additions & 77 deletions posthog/api/test/__snapshots__/test_annotation.ambr
Original file line number Diff line number Diff line change
@@ -256,83 +256,6 @@
LIMIT 1000 /*controller='project_annotations-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/annotations/%3F%24'*/
'
---
# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.15
'
SELECT "posthog_annotation"."id",
"posthog_annotation"."content",
"posthog_annotation"."created_at",
"posthog_annotation"."updated_at",
"posthog_annotation"."dashboard_item_id",
"posthog_annotation"."team_id",
"posthog_annotation"."organization_id",
"posthog_annotation"."created_by_id",
"posthog_annotation"."scope",
"posthog_annotation"."creation_type",
"posthog_annotation"."date_marker",
"posthog_annotation"."deleted",
"posthog_annotation"."apply_all",
"posthog_dashboarditem"."id",
"posthog_dashboarditem"."name",
"posthog_dashboarditem"."derived_name",
"posthog_dashboarditem"."description",
"posthog_dashboarditem"."team_id",
"posthog_dashboarditem"."filters",
"posthog_dashboarditem"."filters_hash",
"posthog_dashboarditem"."query",
"posthog_dashboarditem"."order",
"posthog_dashboarditem"."deleted",
"posthog_dashboarditem"."saved",
"posthog_dashboarditem"."created_at",
"posthog_dashboarditem"."last_refresh",
"posthog_dashboarditem"."refreshing",
"posthog_dashboarditem"."created_by_id",
"posthog_dashboarditem"."is_sample",
"posthog_dashboarditem"."short_id",
"posthog_dashboarditem"."favorited",
"posthog_dashboarditem"."refresh_attempt",
"posthog_dashboarditem"."last_modified_at",
"posthog_dashboarditem"."last_modified_by_id",
"posthog_dashboarditem"."dashboard_id",
"posthog_dashboarditem"."layouts",
"posthog_dashboarditem"."color",
"posthog_dashboarditem"."dive_dashboard_id",
"posthog_dashboarditem"."updated_at",
"posthog_dashboarditem"."deprecated_tags",
"posthog_dashboarditem"."tags",
"posthog_user"."id",
"posthog_user"."password",
"posthog_user"."last_login",
"posthog_user"."first_name",
"posthog_user"."last_name",
"posthog_user"."is_staff",
"posthog_user"."is_active",
"posthog_user"."date_joined",
"posthog_user"."uuid",
"posthog_user"."current_organization_id",
"posthog_user"."current_team_id",
"posthog_user"."email",
"posthog_user"."pending_email",
"posthog_user"."temporary_token",
"posthog_user"."distinct_id",
"posthog_user"."is_email_verified",
"posthog_user"."requested_password_reset_at",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."email_opt_in",
"posthog_user"."partial_notification_settings",
"posthog_user"."anonymize_data",
"posthog_user"."toolbar_mode",
"posthog_user"."events_column_config"
FROM "posthog_annotation"
LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_annotation"."dashboard_item_id" = "posthog_dashboarditem"."id")
LEFT OUTER JOIN "posthog_user" ON ("posthog_annotation"."created_by_id" = "posthog_user"."id")
WHERE ((("posthog_annotation"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid
AND "posthog_annotation"."scope" = 'organization')
OR "posthog_annotation"."team_id" = 2)
AND NOT "posthog_annotation"."deleted")
ORDER BY "posthog_annotation"."date_marker" DESC
LIMIT 1000 /*controller='project_annotations-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/annotations/%3F%24'*/
'
---
# name: TestAnnotation.test_retrieving_annotation_is_not_n_plus_1.2
'
SELECT "posthog_organizationmembership"."id",
31 changes: 0 additions & 31 deletions posthog/api/test/__snapshots__/test_cohort.ambr
Original file line number Diff line number Diff line change
@@ -81,37 +81,6 @@
AND version < '2')
'
---
# name: TestCohort.test_async_deletion_of_cohort.12
'
/* celery:posthog.celery.clickhouse_clear_removed_data */
ALTER TABLE cohortpeople
DELETE
WHERE (team_id = 2
AND cohort_id = '1'
AND version < '2')
'
---
# name: TestCohort.test_async_deletion_of_cohort.13
'OPTIMIZE TABLE cohortpeople FINAL SETTINGS mutations_sync = 2'
---
# name: TestCohort.test_async_deletion_of_cohort.14
'
SELECT count()
FROM cohortpeople
WHERE cohort_id = 2
'
---
# name: TestCohort.test_async_deletion_of_cohort.15
'
/* celery:posthog.celery.clickhouse_clear_removed_data */
SELECT DISTINCT team_id,
cohort_id
FROM cohortpeople
WHERE (team_id = 2
AND cohort_id = '1'
AND version < '2')
'
---
# name: TestCohort.test_async_deletion_of_cohort.2
'
/* user_id:106 celery:posthog.tasks.calculate_cohort.calculate_cohort_ch */
16 changes: 0 additions & 16 deletions posthog/api/test/__snapshots__/test_decide.ambr
Original file line number Diff line number Diff line change
@@ -76,22 +76,6 @@
LIMIT 21 /*controller='team-detail',route='api/projects/%28%3FP%3Cid%3E%5B%5E/.%5D%2B%29/%3F%24'*/
'
---
# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.10
'
SELECT "posthog_pluginconfig"."id",
"posthog_pluginconfig"."web_token",
"posthog_pluginsourcefile"."updated_at",
"posthog_plugin"."updated_at",
"posthog_pluginconfig"."updated_at"
FROM "posthog_pluginconfig"
INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id")
INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id")
WHERE ("posthog_pluginconfig"."enabled"
AND "posthog_pluginsourcefile"."filename" = 'site.ts'
AND "posthog_pluginsourcefile"."status" = 'TRANSPILED'
AND "posthog_pluginconfig"."team_id" = 2)
'
---
# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.2
'
SELECT "posthog_organizationmembership"."id",
12 changes: 0 additions & 12 deletions posthog/api/test/__snapshots__/test_element.ambr
Original file line number Diff line number Diff line change
@@ -127,15 +127,3 @@
LIMIT 1 /*controller='element-stats',route='api/element/stats/%3F%24'*/
'
---
# name: TestElement.test_element_stats_postgres_queries_are_as_expected.5
'
SELECT "ee_license"."id",
"ee_license"."created_at",
"ee_license"."plan",
"ee_license"."valid_until",
"ee_license"."key",
"ee_license"."max_users"
FROM "ee_license"
WHERE ""ee_license"."valid_until">='LICENSE-TIMESTAMP'::timestamptz" /*controller='element-stats',route='api/element/stats/%3F%24'*/
'
---
15 changes: 0 additions & 15 deletions posthog/api/test/__snapshots__/test_feature_flag.ambr
Original file line number Diff line number Diff line change
@@ -334,21 +334,6 @@
HAVING max(is_deleted) = 0)
'
---
# name: TestResiliency.test_feature_flags_v3_with_a_working_slow_db
'
SELECT pg_sleep(1);

SELECT (("posthog_person"."properties" -> 'email') = '"[email protected]"'
AND "posthog_person"."properties" ? 'email'
AND NOT (("posthog_person"."properties" -> 'email') = 'null')) AS "flag_X_condition_0",
(true) AS "flag_X_condition_0"
FROM "posthog_person"
INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id")
WHERE ("posthog_persondistinctid"."distinct_id" = 'example_id'
AND "posthog_persondistinctid"."team_id" = 2
AND "posthog_person"."team_id" = 2)
'
---
# name: TestResiliency.test_feature_flags_v3_with_experience_continuity_working_slow_db
'
WITH target_person_ids AS
18 changes: 0 additions & 18 deletions posthog/api/test/__snapshots__/test_insight.ambr
Original file line number Diff line number Diff line change
@@ -1471,24 +1471,6 @@
LIMIT 21 /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
'
---
# name: TestInsight.test_listing_insights_does_not_nplus1.30
'
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
"posthog_taggeditem"."dashboard_id",
"posthog_taggeditem"."insight_id",
"posthog_taggeditem"."event_definition_id",
"posthog_taggeditem"."property_definition_id",
"posthog_taggeditem"."action_id",
"posthog_taggeditem"."feature_flag_id"
FROM "posthog_taggeditem"
WHERE "posthog_taggeditem"."insight_id" IN (1,
2,
3,
4,
5 /* ... */) /*controller='project_insights-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/insights/%3F%24'*/
'
---
# name: TestInsight.test_listing_insights_does_not_nplus1.4
'
SELECT "posthog_team"."id",
12 changes: 6 additions & 6 deletions posthog/api/test/__snapshots__/test_person.ambr
Original file line number Diff line number Diff line change
@@ -458,8 +458,8 @@
(SELECT id
FROM person
WHERE team_id = 2
AND ((replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '') ILIKE '%00000000-0000-4000-8000-000000000001%')
OR (id = '00000000-0000-4000-8000-000000000001'
AND ((replaceRegexpAll(JSONExtractRaw(properties, 'email'), '^"|"$', '') ILIKE '%00000000-0000-4000-8000-000000000000%')
OR (id = '00000000-0000-4000-8000-000000000000'
OR id IN
(SELECT person_id
FROM
@@ -469,12 +469,12 @@
WHERE team_id = 2
GROUP BY distinct_id
HAVING argMax(is_deleted, version) = 0)
WHERE distinct_id = '00000000-0000-4000-8000-000000000001' ))) )
WHERE distinct_id = '00000000-0000-4000-8000-000000000000' ))) )
GROUP BY id
HAVING max(is_deleted) = 0
AND argMax(created_at, version) < now() + INTERVAL 1 DAY
AND ((replaceRegexpAll(JSONExtractRaw(argMax(person.properties, version), 'email'), '^"|"$', '') ILIKE '%00000000-0000-4000-8000-000000000001%')
OR (id = '00000000-0000-4000-8000-000000000001'
AND ((replaceRegexpAll(JSONExtractRaw(argMax(person.properties, version), 'email'), '^"|"$', '') ILIKE '%00000000-0000-4000-8000-000000000000%')
OR (id = '00000000-0000-4000-8000-000000000000'
OR id IN
(SELECT person_id
FROM
@@ -484,7 +484,7 @@
WHERE team_id = 2
GROUP BY distinct_id
HAVING argMax(is_deleted, version) = 0)
WHERE distinct_id = '00000000-0000-4000-8000-000000000001' )))
WHERE distinct_id = '00000000-0000-4000-8000-000000000000' )))
ORDER BY argMax(created_at, version) DESC, id
LIMIT 100
'
74 changes: 0 additions & 74 deletions posthog/test/__snapshots__/test_plugin.ambr
Original file line number Diff line number Diff line change
@@ -82,28 +82,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_tgz_with_explicit_index_js_works.6
'
SELECT "posthog_pluginsourcefile"."id",
"posthog_pluginsourcefile"."plugin_id",
"posthog_pluginsourcefile"."filename",
"posthog_pluginsourcefile"."source",
"posthog_pluginsourcefile"."status",
"posthog_pluginsourcefile"."transpiled",
"posthog_pluginsourcefile"."error",
"posthog_pluginsourcefile"."updated_at"
FROM "posthog_pluginsourcefile"
WHERE ("posthog_pluginsourcefile"."filename" IN ('frontend.tsx',
'site.ts')
AND "posthog_pluginsourcefile"."plugin_id" = 2)
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_tgz_with_explicit_index_js_works.7
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_with_explicit_index_js_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -146,12 +124,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_with_explicit_index_js_works.3
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_with_index_ts_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -194,12 +166,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_with_index_ts_works.3
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_without_index_ts_but_frontend_tsx_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -242,12 +208,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_without_index_ts_but_frontend_tsx_works.3
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_without_index_ts_but_site_Ts_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -290,12 +250,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_from_zip_without_index_ts_but_site_Ts_works.3
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_twice_from_zip_with_index_ts_replaced_by_frontend_tsx_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -380,28 +334,6 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_twice_from_zip_with_index_ts_replaced_by_frontend_tsx_works.6
'
SELECT "posthog_pluginsourcefile"."id",
"posthog_pluginsourcefile"."plugin_id",
"posthog_pluginsourcefile"."filename",
"posthog_pluginsourcefile"."source",
"posthog_pluginsourcefile"."status",
"posthog_pluginsourcefile"."transpiled",
"posthog_pluginsourcefile"."error",
"posthog_pluginsourcefile"."updated_at"
FROM "posthog_pluginsourcefile"
WHERE ("posthog_pluginsourcefile"."filename" IN ('site.ts',
'index.ts')
AND "posthog_pluginsourcefile"."plugin_id" = 2)
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_twice_from_zip_with_index_ts_replaced_by_frontend_tsx_works.7
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_with_subdir_works
'
SELECT "posthog_pluginsourcefile"."id",
@@ -444,9 +376,3 @@
FROM "posthog_pluginsourcefile"
'
---
# name: TestPluginSourceFile.test_sync_from_plugin_archive_with_subdir_works.3
'
SELECT COUNT(*) AS "__count"
FROM "posthog_pluginsourcefile"
'
---
20 changes: 10 additions & 10 deletions requirements-dev.in
Original file line number Diff line number Diff line change
@@ -26,22 +26,22 @@ prance==0.22.2.22.0
black==22.8.0
types-markdown==3.3.9
types-PyYAML==6.0.1
types-freezegun==1.1.3
types-freezegun==1.1.10
types-python-dateutil>=2.8.3
types-pytz==2021.3.2
types-redis==4.3.20
types-requests==2.26.1
parameterized==0.9.0
pytest==6.2.5
pytest-asyncio==0.20.3
pytest-django==4.1.0
pytest-env==0.6.2
pytest-icdiff==0.5
pytest-mock==3.5.1
pytest-cov==2.12.1
pytest-split==0.6.0
pytest==7.4.0
pytest-asyncio==0.21.1
pytest-cov==4.1.0
pytest-django==4.5.2
pytest-env==0.8.2
pytest-icdiff==0.6
pytest-mock==3.11.1
pytest-split==0.8.1
pytest-watch==4.2.0
python-dateutil>=2.8.2
responses==0.23.1
syrupy==1.4.6
syrupy==1.7.4
flaky==3.7.0
31 changes: 15 additions & 16 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ attrs==21.4.0
# -c requirements.txt
# jsonschema
# openapi-schema-validator
# pytest
# syrupy
black==22.8.0
# via
@@ -56,7 +55,7 @@ coreapi==2.3.3
# via djangorestframework-stubs
coreschema==0.0.4
# via coreapi
coverage==5.5
coverage[toml]==5.5
# via pytest-cov
cryptography==37.0.2
# via
@@ -86,6 +85,8 @@ docopt==0.6.2
# via pytest-watch
email-validator==1.3.1
# via pydantic
exceptiongroup==1.1.2
# via pytest
faker==17.5.0
# via -r requirements-dev.in
fakeredis[lua]==2.11.0
@@ -173,8 +174,6 @@ prance==0.22.2.22.0
# -c requirements.txt
# -r requirements-dev.in
# datamodel-code-generator
py==1.10.0
# via pytest
pycparser==2.20
# via
# -c requirements.txt
@@ -199,7 +198,7 @@ pysocks==1.7.1
# via
# -c requirements.txt
# urllib3
pytest==6.2.5
pytest==7.4.0
# via
# -r requirements-dev.in
# pytest-asyncio
@@ -211,19 +210,19 @@ pytest==6.2.5
# pytest-split
# pytest-watch
# syrupy
pytest-asyncio==0.20.3
pytest-asyncio==0.21.1
# via -r requirements-dev.in
pytest-cov==2.12.1
pytest-cov==4.1.0
# via -r requirements-dev.in
pytest-django==4.1.0
pytest-django==4.5.2
# via -r requirements-dev.in
pytest-env==0.6.2
pytest-env==0.8.2
# via -r requirements-dev.in
pytest-icdiff==0.5
pytest-icdiff==0.6
# via -r requirements-dev.in
pytest-mock==3.5.1
pytest-mock==3.11.1
# via -r requirements-dev.in
pytest-split==0.6.0
pytest-split==0.8.1
# via -r requirements-dev.in
pytest-watch==4.2.0
# via -r requirements-dev.in
@@ -279,22 +278,22 @@ sqlparse==0.4.4
# via
# -c requirements.txt
# django
syrupy==1.4.6
syrupy==1.7.4
# via -r requirements-dev.in
toml==0.10.1
# via
# coverage
# datamodel-code-generator
# pytest
# pytest-cov
tomli==1.2.3
# via
# black
# build
# mypy
# pyproject-hooks
# pytest
typed-ast==1.5.4
# via datamodel-code-generator
types-freezegun==1.1.3
types-freezegun==1.1.10
# via -r requirements-dev.in
types-markdown==3.3.9
# via -r requirements-dev.in

0 comments on commit 48515cc

Please sign in to comment.