Skip to content

Commit

Permalink
syrupy 4
Browse files Browse the repository at this point in the history
  • Loading branch information
alangenfeld committed Feb 22, 2024
1 parent b852c0c commit ad10be4
Show file tree
Hide file tree
Showing 32 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/docs_snippets/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"seaborn",
"scikit-learn",
"slack_sdk",
"syrupy<4", # 3.7 compatible,
"syrupy",
"dbt-duckdb",
"xgboost",
"dagster-webserver[test]",
Expand Down
11 changes: 9 additions & 2 deletions python_modules/dagster-graphql/dagster_graphql_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from syrupy.extensions.amber import AmberSnapshotExtension

if TYPE_CHECKING:
from syrupy.location import PyTestLocation
from syrupy.types import SnapshotIndex


Expand All @@ -19,8 +20,14 @@ def unset_dagster_home():


class SharedSnapshotExtension(AmberSnapshotExtension):
def get_snapshot_name(self, *, index: "SnapshotIndex") -> str:
snapshot_name = self.test_location.snapshot_name
@classmethod
def get_snapshot_name(
cls,
*,
index: "SnapshotIndex",
test_location: "PyTestLocation",
) -> str:
snapshot_name = test_location.snapshot_name

# Exclude any of the GraphQLContextVariant suffixes from the snapshot name
# so that we don't have to re-generate an identical snapshot for each one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_all_snapshot_ids[0]
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestAssetAwareEventLog.test_all_asset_keys[0]
dict({
'assetsOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestComposites.test_composites[0]
dict({
'pipelineOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestComputeLogs.test_compute_logs_subscription_graphql[0]
list([
dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestEnvironmentSchema.test_basic_invalid_config_on_run_config_schema[0]
dict({
'runConfigSchemaOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestExpectations.test_basic_expectations_within_compute_step_events[0]
list([
dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestGraphs.test_basic_graphs[0]
dict({
'graphOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_query_inputs_outputs[0]
dict({
'repositoryOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_mode_fetch_loggers[0]
dict({
'pipelineOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestMaterializations.test_materializations[0]
list([
'RunStartingEvent',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestPartitionSets.test_get_partition_set[0]
dict({
'partitionSetOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_fetch_snapshot_or_error_by_active_pipeline_name_not_found[0]
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestReexecution.test_full_pipeline_reexecution_fs_storage[0]
dict({
'launchPipelineExecution': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_mode_fetch_resources[0]
dict({
'pipelineOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestRetryExecution.test_pipeline_reexecution_info_query[0]
list([
'sum_sq_op',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: TestSensors.test_get_sensor[0]
dict({
'__typename': 'Sensor',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_query_all_solids[0]
dict({
'repositoryOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_fetch_top_level_resource[0]
dict({
'topLevelResourceDetailsOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_get_used_env_vars[0]
dict({
'utilizedEnvVarsOrError': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_basic_ops_config
dict({
'execution': dict({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_external_job_data
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_create_execution_plan_with_dep
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_basic_dep_fan_out
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_mode_snap
'{"__class__": "ModeDefSnap", "description": null, "logger_def_snaps": [{"__class__": "LoggerDefSnap", "config_field_snap": {"__class__": "ConfigFieldSnap", "default_provided": false, "default_value_as_json_str": null, "description": null, "is_required": false, "name": "config", "type_key": "Any"}, "description": "logger_description", "name": "no_config_logger"}, {"__class__": "LoggerDefSnap", "config_field_snap": {"__class__": "ConfigFieldSnap", "default_provided": false, "default_value_as_json_str": null, "description": null, "is_required": true, "name": "config", "type_key": "Shape.6930c1ab2255db7c39e92b59c53bab16a55f80c1"}, "description": null, "name": "some_logger"}], "name": "default", "resource_def_snaps": [{"__class__": "ResourceDefSnap", "config_field_snap": {"__class__": "ConfigFieldSnap", "default_provided": false, "default_value_as_json_str": null, "description": null, "is_required": false, "name": "config", "type_key": "Any"}, "description": "Built-in filesystem IO manager that stores and retrieves values using pickling.", "name": "io_manager"}, {"__class__": "ResourceDefSnap", "config_field_snap": {"__class__": "ConfigFieldSnap", "default_provided": false, "default_value_as_json_str": null, "description": null, "is_required": false, "name": "config", "type_key": "Any"}, "description": "resource_description", "name": "no_config_resource"}, {"__class__": "ResourceDefSnap", "config_field_snap": {"__class__": "ConfigFieldSnap", "default_provided": false, "default_value_as_json_str": null, "description": null, "is_required": true, "name": "config", "type_key": "Shape.4384fce472621a1d43c54ff7e52b02891791103f"}, "description": null, "name": "some_resource"}], "root_config_key": "Shape.02d70527880bf8d440339753c017df76ba0c21b0"}'
# ---
2 changes: 1 addition & 1 deletion python_modules/dagster/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_version() -> str:
"pytest-xdist==3.3.1",
"pytest>=7.0.1",
"responses<=0.23.1", # https://github.com/getsentry/responses/issues/654
"syrupy<4", # 3.7 compatible,
"syrupy>=4.0.0",
"tox==3.25.0",
"morefs[asynclocal]; python_version>='3.8'",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_complex_dag
'''
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_yielded_results_config_pandas[hello_world_pandas_job_v2-./great_expectations]
'''

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# serializer version: 1
# name: test_yielded_results_config_pandas[hello_world_pandas_job_v2-./great_expectations]
'''

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion python_modules/libraries/dagster-polars/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_version() -> str:
"deltalake": ["deltalake>=0.15.0"],
"gcp": ["dagster-gcp>=0.19.5"],
"test": [
"pytest>=7.3.1",
"pytest>=7.3.1,<8.0.0",
"hypothesis>=6.89.0",
"deepdiff>=6.3.0",
"pytest-cases>=3.6.14",
Expand Down

0 comments on commit ad10be4

Please sign in to comment.