inline-snapshot 0.36.2__tar.gz → 0.37.0__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.
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/AGENTS.md +8 -5
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/CHANGELOG.md +7 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/PKG-INFO +1 -1
- inline_snapshot-0.37.0/benchmarks/_compat.py +14 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/bench_pytest.py +3 -3
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/bench_snapshot.py +2 -3
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/conftest.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/external.md +1 -1
- inline_snapshot-0.37.0/docs/is_snapshot.md +7 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/mkdocs.yml +1 -0
- inline_snapshot-0.37.0/src/inline_snapshot/__init__.py +45 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/__init__.py +17 -16
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_change.py +5 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_code_repr.py +9 -9
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_config.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_builder.py +11 -11
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_call.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_code.py +5 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_dict.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_external.py +8 -8
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_sequence.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_undefined.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_custom_unmanaged.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/_uncustomized.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_external.py +19 -17
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_external_base.py +7 -7
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_external_file.py +7 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_external_location.py +6 -6
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_find_external.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/_binary.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/_json.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/_protocol.py +5 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/_rich_svg.py +2 -2
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/_text.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_outsource.py +5 -9
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_storage/_hash.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_storage/_protocol.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_storage/_uuid.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_tracked_files.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_format.py +2 -2
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_get_snapshot_value.py +4 -6
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_global_state.py +22 -13
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_inline_snapshot.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_is.py +2 -3
- inline_snapshot-0.37.0/src/inline_snapshot/_core/_is_snapshot.py +21 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_problems.py +2 -2
- inline_snapshot-0.36.2/src/inline_snapshot/_new_adapter.py → inline_snapshot-0.37.0/src/inline_snapshot/_core/_reconcile.py +52 -98
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/base.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/collection_operation.py +6 -6
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/dict_operation.py +5 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/eq_operation.py +5 -5
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/min_max_operation.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/snapshot_data.py +3 -3
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/snapshot_value.py +13 -13
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/value_conversion.py +67 -17
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot_arg.py +17 -17
- inline_snapshot-0.36.2/src/inline_snapshot/_adapter_context.py → inline_snapshot-0.37.0/src/inline_snapshot/_core/_snapshot_context.py +2 -2
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot_session.py +18 -19
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_source_file.py +4 -4
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_types.py +1 -1
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_utils.py +1 -1
- inline_snapshot-0.37.0/src/inline_snapshot/_core/plugin/__init__.py +18 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/plugin/_default_plugin.py +8 -151
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/plugin/_spec.py +1 -1
- inline_snapshot-0.37.0/src/inline_snapshot/_extensions/__init__.py +1 -0
- inline_snapshot-0.37.0/src/inline_snapshot/_extensions/attrs.py +41 -0
- inline_snapshot-0.37.0/src/inline_snapshot/_extensions/dirty_equals.py +39 -0
- inline_snapshot-0.37.0/src/inline_snapshot/_extensions/pydantic.py +54 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/extra.py +4 -5
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/fix_pytest_diff.py +2 -2
- inline_snapshot-0.37.0/src/inline_snapshot/plugin.py +19 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/pydantic_fix.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/pytest_plugin.py +11 -11
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/testing/_example.py +13 -13
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/testing/_terminal_svg.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/version.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_change_types.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_sequence.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/conftest.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/storage/test_hash.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/storage/test_uuid.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/test_external.py +12 -12
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/test_external_file.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/test_external_location.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/test_formats.py +5 -5
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_align.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_benchmark_fixtures.py +18 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_change.py +10 -10
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_change_collection_error.py +3 -3
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_code_repr.py +7 -7
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_config.py +3 -3
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_dirty_equals.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_docs.py +6 -6
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_encoding.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_get_snapshot_value.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_hasrepr.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_inline_snapshot.py +8 -8
- inline_snapshot-0.37.0/tests/test_is_snapshot.py +94 -0
- inline_snapshot-0.37.0/tests/test_optional_extensions.py +41 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_preserve_values.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_pypy.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_rewrite_code.py +6 -6
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_snapshot_arg.py +35 -35
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_snapshot_arg_unmanaged.py +1 -1
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_string.py +2 -2
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/utils.py +1 -1
- inline_snapshot-0.36.2/src/inline_snapshot/plugin/__init__.py +0 -18
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/FUNDING.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/actions/setup/action.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/copilot-instructions.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/pull_request_template.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/benchmark-report.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/benchmarks.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/ci.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/cog.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/deploy_development_docs.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/docs.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.github/workflows/test_docs.yml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.gitignore +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.inline-snapshot/external/.gitignore +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.inline-snapshot/external/ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d.json +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.inline-snapshot/files_using_external.txt +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/.pre-commit-config.yaml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/CONTRIBUTING.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/LICENSE +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/MANIFEST.in +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/README.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/asv.conf.json +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/README.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/__init__.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/_fixtures.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/benchmarks/_workloads.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/changelog.d/.gitkeep +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/alternatives.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/code_generation/string-update.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/create_fix.mp4 +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/favicon.png +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/favicon.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/introduction/show-error.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/introduction/simple-example-changed.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/introduction/simple-example.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/logo.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/logo_orig.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/pycharm_run.mp4 +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/pytest/create-fix-trim-update.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/pytest/report.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/pytest/review.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/pytest/short-report.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/readme/example-snapshot-arg.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/assets/readme/example-snapshot.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/categories.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/changelog.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/cmp_snapshot.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/code_generation.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/configuration.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/contributing.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/customize_repr.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/eq_snapshot.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/assets/register-is-array-for.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/assets/register-numberset-format.rich.svg +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/external_file.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/outsource.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/external/register_format.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/extra.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/fix_assert.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/get_snapshot_value.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/getitem_snapshot.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/howto/parametrize.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/in_snapshot.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/index.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/insiders.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/limitations.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/plugin.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/plugins/pyproject.toml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/plugins/replace_url.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/pycharm.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/pytest.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/snapshot_arg.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/styles/extra.css +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/testing.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/theme/main.html +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/third_party.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/docs/types.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/known_issues/pydantic-ai-report-memory.md +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/pyproject.toml +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/redeploy_docs.sh +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/scripts/clean_changelog_fragments.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/scripts/replace_words.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/scripts/test_downstream.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_align.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_compare_context.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_customize/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_exceptions.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_diff.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_format/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_external/_storage/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_flags.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_generator_utils.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_rewrite_code.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_sentinels.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_snapshot/_operation/__init__.py +0 -0
- {inline_snapshot-0.36.2/src/inline_snapshot → inline_snapshot-0.37.0/src/inline_snapshot/_core}/_unmanaged.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/_fix_assert.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/fix_pytest_cache.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/py.typed +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/syntax_warnings.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/src/inline_snapshot/testing/__init__.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/test-repos.json +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/testing/generate_tests.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/__init__.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_call.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_dataclass.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_dict.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_general.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/adapter/test_namedtuple.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/__init__.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/storage/test_generic.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/external/test_module_name.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_builder.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_ci.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_customize.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_datetime_timezone.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_example.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_formatting.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_fstring.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_is.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_pydantic.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_pytest_diff_fix.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_pytest_plugin.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_pytester.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_raises.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_skip_updates.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_snapshot_value.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_storage.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_transformed.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_typing.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_update.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_warns.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_without_node.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_xdist.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/tests/test_xfail.py +0 -0
- {inline_snapshot-0.36.2 → inline_snapshot-0.37.0}/uv.lock +0 -0
|
@@ -10,11 +10,14 @@ The project supports Python 3.9 through 3.14 and PyPy where possible. CI runs ac
|
|
|
10
10
|
|
|
11
11
|
- `src/inline_snapshot/`: package source.
|
|
12
12
|
- `src/inline_snapshot/pytest_plugin.py`: pytest entry point and CLI flag handling.
|
|
13
|
-
- `src/inline_snapshot/
|
|
14
|
-
- `src/inline_snapshot/
|
|
15
|
-
- `src/inline_snapshot/
|
|
16
|
-
- `src/inline_snapshot/
|
|
17
|
-
- `src/inline_snapshot/
|
|
13
|
+
- `src/inline_snapshot/_core/_snapshot_session.py`: snapshot sessions, reporting, and applying changes.
|
|
14
|
+
- `src/inline_snapshot/_core/_inline_snapshot.py`, `_snapshot_arg.py`, `_get_snapshot_value.py`: main public snapshot behavior.
|
|
15
|
+
- `src/inline_snapshot/_core/_snapshot/`: snapshot value implementations such as equality, dict, min/max, collection, and undecided values.
|
|
16
|
+
- `src/inline_snapshot/_core/_customize/`: code-generation customization support.
|
|
17
|
+
- `src/inline_snapshot/_core/_external/`: external snapshot files, formats, storage, diffing, and outsourcing.
|
|
18
|
+
- `src/inline_snapshot/_core/plugin/`: plugin hook specification and default plugin.
|
|
19
|
+
- `src/inline_snapshot/plugin.py`: public customization API.
|
|
20
|
+
- `src/inline_snapshot/_extensions/`: optional attrs, Pydantic, and dirty-equals plugins.
|
|
18
21
|
- `src/inline_snapshot/testing/_example.py`: preferred test harness for new behavior tests.
|
|
19
22
|
- `tests/`: pytest suite. Adapter tests live in `tests/adapter/`; external snapshot tests live in `tests/external/`.
|
|
20
23
|
- `docs/`: MkDocs Material documentation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: inline-snapshot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.37.0
|
|
4
4
|
Summary: golden master/snapshot/approval testing library which puts the values right into your source code
|
|
5
5
|
Project-URL: Changelog, https://15r10nk.github.io/inline-snapshot/latest/changelog/
|
|
6
6
|
Project-URL: Discussions, https://github.com/15r10nk/inline-snapshots/discussions
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Support benchmarking revisions before and after the core package move."""
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from importlib.util import find_spec
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def global_state_module():
|
|
8
|
+
if find_spec("inline_snapshot._core") is not None:
|
|
9
|
+
return "inline_snapshot._core._global_state"
|
|
10
|
+
return "inline_snapshot._global_state"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def snapshot_env():
|
|
14
|
+
return import_module(global_state_module()).snapshot_env()
|
|
@@ -7,6 +7,8 @@ import sys
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from tempfile import TemporaryDirectory
|
|
9
9
|
|
|
10
|
+
from ._compat import global_state_module
|
|
11
|
+
from ._compat import snapshot_env
|
|
10
12
|
from ._fixtures import BATCH_SIZE
|
|
11
13
|
from ._fixtures import SUITE_VERSION
|
|
12
14
|
from ._fixtures import pytest_source
|
|
@@ -32,7 +34,7 @@ class PytestSession:
|
|
|
32
34
|
self.original = pytest_source(mode)
|
|
33
35
|
self.path.write_text(self.original, encoding="utf-8")
|
|
34
36
|
(self.root / "conftest.py").write_text(
|
|
35
|
-
"from
|
|
37
|
+
f"from {global_state_module()} import state\n"
|
|
36
38
|
"def pytest_sessionfinish(session):\n"
|
|
37
39
|
f" assert state().active is {mode != 'disabled'}\n",
|
|
38
40
|
encoding="utf-8",
|
|
@@ -106,8 +108,6 @@ class PytestSession:
|
|
|
106
108
|
), output
|
|
107
109
|
if changed:
|
|
108
110
|
# A fast no-rewriting check validates the resulting expected values.
|
|
109
|
-
from inline_snapshot._global_state import snapshot_env
|
|
110
|
-
|
|
111
111
|
from ._fixtures import load_module
|
|
112
112
|
|
|
113
113
|
with snapshot_env() as state:
|
|
@@ -6,6 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from tempfile import TemporaryDirectory
|
|
7
7
|
from textwrap import dedent
|
|
8
8
|
|
|
9
|
+
from ._compat import snapshot_env
|
|
9
10
|
from ._fixtures import CASES
|
|
10
11
|
from ._fixtures import SUITE_VERSION
|
|
11
12
|
|
|
@@ -72,7 +73,7 @@ class Comparison:
|
|
|
72
73
|
|
|
73
74
|
sys.path.insert(0, {str(Path(__file__).resolve().parent.parent)!r})
|
|
74
75
|
from benchmarks._fixtures import BATCH_SIZE, load_module, snapshot_functions, source
|
|
75
|
-
from
|
|
76
|
+
from benchmarks._compat import snapshot_env
|
|
76
77
|
|
|
77
78
|
directory = TemporaryDirectory()
|
|
78
79
|
atexit.register(directory.cleanup)
|
|
@@ -117,8 +118,6 @@ class RetainedSnapshotState:
|
|
|
117
118
|
frame_payload_size = 100_000
|
|
118
119
|
|
|
119
120
|
def setup(self, case):
|
|
120
|
-
from inline_snapshot._global_state import snapshot_env
|
|
121
|
-
|
|
122
121
|
from ._fixtures import load_module
|
|
123
122
|
from ._fixtures import source
|
|
124
123
|
|
|
@@ -153,7 +153,7 @@ To store data in a different location, set the `storage-dir` option in pyproject
|
|
|
153
153
|
inline-snapshot supports several built-in formats for external snapshots. The format used is determined by the given data type: bytes are stored in a `.bin` file, and strings are stored in a `.txt` file by default. More complex data types are stored in a `.json` file.
|
|
154
154
|
|
|
155
155
|
<!--[[[cog
|
|
156
|
-
from inline_snapshot._global_state import state
|
|
156
|
+
from inline_snapshot._core._global_state import state
|
|
157
157
|
import cog
|
|
158
158
|
|
|
159
159
|
cog.out("|Suffix|Priority|Description|\n")
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from ._core import BinaryDiff
|
|
2
|
+
from ._core import Category
|
|
3
|
+
from ._core import Format
|
|
4
|
+
from ._core import HasRepr
|
|
5
|
+
from ._core import Is
|
|
6
|
+
from ._core import Snapshot
|
|
7
|
+
from ._core import SnapshotArg
|
|
8
|
+
from ._core import TextDiff
|
|
9
|
+
from ._core import UsageError
|
|
10
|
+
from ._core import customize_repr
|
|
11
|
+
from ._core import declare_unmanaged
|
|
12
|
+
from ._core import external
|
|
13
|
+
from ._core import external_file
|
|
14
|
+
from ._core import get_snapshot_value
|
|
15
|
+
from ._core import is_snapshot
|
|
16
|
+
from ._core import outsource
|
|
17
|
+
from ._core import register_format
|
|
18
|
+
from ._core import register_format_alias
|
|
19
|
+
from ._core import snapshot
|
|
20
|
+
from ._core import snapshot_arg
|
|
21
|
+
from .version import __version__
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"snapshot",
|
|
25
|
+
"external",
|
|
26
|
+
"outsource",
|
|
27
|
+
"customize_repr",
|
|
28
|
+
"HasRepr",
|
|
29
|
+
"Is",
|
|
30
|
+
"Category",
|
|
31
|
+
"Snapshot",
|
|
32
|
+
"SnapshotArg",
|
|
33
|
+
"UsageError",
|
|
34
|
+
"register_format_alias",
|
|
35
|
+
"register_format",
|
|
36
|
+
"Format",
|
|
37
|
+
"TextDiff",
|
|
38
|
+
"BinaryDiff",
|
|
39
|
+
"external_file",
|
|
40
|
+
"declare_unmanaged",
|
|
41
|
+
"get_snapshot_value",
|
|
42
|
+
"is_snapshot",
|
|
43
|
+
"snapshot_arg",
|
|
44
|
+
"__version__",
|
|
45
|
+
]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
from inline_snapshot._external._diff import TextDiff
|
|
1
|
+
"""Core snapshot evaluation, customization, storage, and source rewriting."""
|
|
3
2
|
|
|
4
3
|
from ._code_repr import HasRepr
|
|
5
4
|
from ._code_repr import customize_repr
|
|
6
5
|
from ._exceptions import UsageError
|
|
6
|
+
from ._external._diff import BinaryDiff
|
|
7
|
+
from ._external._diff import TextDiff
|
|
7
8
|
from ._external._external import external
|
|
8
9
|
from ._external._external_file import external_file
|
|
9
10
|
from ._external._format._protocol import Format
|
|
@@ -13,32 +14,32 @@ from ._external._outsource import outsource
|
|
|
13
14
|
from ._get_snapshot_value import get_snapshot_value
|
|
14
15
|
from ._inline_snapshot import snapshot
|
|
15
16
|
from ._is import Is
|
|
17
|
+
from ._is_snapshot import is_snapshot
|
|
16
18
|
from ._snapshot_arg import snapshot_arg
|
|
17
19
|
from ._types import Category
|
|
18
20
|
from ._types import Snapshot
|
|
19
21
|
from ._types import SnapshotArg
|
|
20
22
|
from ._unmanaged import declare_unmanaged
|
|
21
|
-
from .version import __version__
|
|
22
23
|
|
|
23
24
|
__all__ = [
|
|
24
|
-
"
|
|
25
|
+
"HasRepr",
|
|
26
|
+
"customize_repr",
|
|
27
|
+
"UsageError",
|
|
28
|
+
"BinaryDiff",
|
|
29
|
+
"TextDiff",
|
|
25
30
|
"external",
|
|
31
|
+
"external_file",
|
|
32
|
+
"Format",
|
|
33
|
+
"register_format",
|
|
34
|
+
"register_format_alias",
|
|
26
35
|
"outsource",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
36
|
+
"get_snapshot_value",
|
|
37
|
+
"snapshot",
|
|
29
38
|
"Is",
|
|
39
|
+
"is_snapshot",
|
|
40
|
+
"snapshot_arg",
|
|
30
41
|
"Category",
|
|
31
42
|
"Snapshot",
|
|
32
43
|
"SnapshotArg",
|
|
33
|
-
"UsageError",
|
|
34
|
-
"register_format_alias",
|
|
35
|
-
"register_format",
|
|
36
|
-
"Format",
|
|
37
|
-
"TextDiff",
|
|
38
|
-
"BinaryDiff",
|
|
39
|
-
"external_file",
|
|
40
44
|
"declare_unmanaged",
|
|
41
|
-
"get_snapshot_value",
|
|
42
|
-
"snapshot_arg",
|
|
43
|
-
"__version__",
|
|
44
45
|
]
|
|
@@ -12,16 +12,16 @@ from typing import cast
|
|
|
12
12
|
from asttokens.util import Token
|
|
13
13
|
from executing.executing import EnhancedAST
|
|
14
14
|
|
|
15
|
-
from inline_snapshot._external._external_location import Location
|
|
16
|
-
from inline_snapshot._external._find_external import ensure_import
|
|
17
|
-
from inline_snapshot._source_file import SourceFile
|
|
15
|
+
from inline_snapshot._core._external._external_location import Location
|
|
16
|
+
from inline_snapshot._core._external._find_external import ensure_import
|
|
17
|
+
from inline_snapshot._core._source_file import SourceFile
|
|
18
18
|
|
|
19
19
|
from ._rewrite_code import ChangeRecorder
|
|
20
20
|
from ._rewrite_code import end_of
|
|
21
21
|
from ._rewrite_code import start_of
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
|
-
from inline_snapshot._external._format._protocol import Format
|
|
24
|
+
from inline_snapshot._core._external._format._protocol import Format
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class ChangeBase:
|
|
@@ -94,7 +94,7 @@ class ExternalRemove(ChangeBase):
|
|
|
94
94
|
|
|
95
95
|
title = f"delete {self.old_location}"
|
|
96
96
|
|
|
97
|
-
from inline_snapshot._external._format._protocol import (
|
|
97
|
+
from inline_snapshot._core._external._format._protocol import (
|
|
98
98
|
get_format_handler_from_suffix,
|
|
99
99
|
)
|
|
100
100
|
|
|
@@ -9,17 +9,17 @@ from unittest import mock
|
|
|
9
9
|
|
|
10
10
|
from typing_extensions import deprecated
|
|
11
11
|
|
|
12
|
-
from inline_snapshot._generator_utils import only_value
|
|
12
|
+
from inline_snapshot._core._generator_utils import only_value
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
|
-
from inline_snapshot.
|
|
15
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
real_repr = repr
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def
|
|
22
|
-
from inline_snapshot.
|
|
21
|
+
def snapshot_context_for_parent_frame():
|
|
22
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
23
23
|
|
|
24
24
|
frame = inspect.currentframe()
|
|
25
25
|
assert frame
|
|
@@ -28,7 +28,7 @@ def adapter_context_for_parent_frame():
|
|
|
28
28
|
frame = frame.f_back
|
|
29
29
|
assert frame
|
|
30
30
|
|
|
31
|
-
return
|
|
31
|
+
return SnapshotContext(frame)
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
class HasRepr:
|
|
@@ -58,7 +58,7 @@ class HasRepr:
|
|
|
58
58
|
if type(other) is not self._type:
|
|
59
59
|
return False
|
|
60
60
|
|
|
61
|
-
with mock_repr(
|
|
61
|
+
with mock_repr(snapshot_context_for_parent_frame()):
|
|
62
62
|
other_repr = value_code_repr(other)
|
|
63
63
|
return other_repr == self._str_repr or other_repr == real_repr(self)
|
|
64
64
|
|
|
@@ -93,16 +93,16 @@ def customize_repr(f):
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
def code_repr(obj):
|
|
96
|
-
with mock_repr(
|
|
96
|
+
with mock_repr(snapshot_context_for_parent_frame()):
|
|
97
97
|
return repr(obj)
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
@contextmanager
|
|
101
|
-
def mock_repr(context:
|
|
101
|
+
def mock_repr(context: SnapshotContext):
|
|
102
102
|
assert context is not None
|
|
103
103
|
|
|
104
104
|
def new_repr(obj):
|
|
105
|
-
from inline_snapshot._customize._builder import Builder
|
|
105
|
+
from inline_snapshot._core._customize._builder import Builder
|
|
106
106
|
|
|
107
107
|
return only_value(
|
|
108
108
|
Builder(_snapshot_context=context)._customize_all(obj)._code_repr(context)
|
|
@@ -5,15 +5,15 @@ from dataclasses import dataclass
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
from typing import Callable
|
|
7
7
|
|
|
8
|
-
from inline_snapshot.
|
|
9
|
-
from inline_snapshot._code_repr import
|
|
10
|
-
from inline_snapshot._code_repr import
|
|
11
|
-
from inline_snapshot.
|
|
12
|
-
from inline_snapshot.
|
|
13
|
-
from inline_snapshot._customize.
|
|
14
|
-
from inline_snapshot._customize.
|
|
15
|
-
from inline_snapshot.
|
|
16
|
-
from inline_snapshot.
|
|
8
|
+
from inline_snapshot._core._code_repr import HasRepr
|
|
9
|
+
from inline_snapshot._core._code_repr import mock_repr
|
|
10
|
+
from inline_snapshot._core._code_repr import value_code_repr
|
|
11
|
+
from inline_snapshot._core._compare_context import compare_context
|
|
12
|
+
from inline_snapshot._core._customize._custom_sequence import CustomSequence
|
|
13
|
+
from inline_snapshot._core._customize._custom_unmanaged import CustomUnmanaged
|
|
14
|
+
from inline_snapshot._core._customize._uncustomized import Uncustomized
|
|
15
|
+
from inline_snapshot._core._exceptions import UsageError
|
|
16
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
17
17
|
|
|
18
18
|
from ._custom import Custom
|
|
19
19
|
from ._custom_call import CustomCall
|
|
@@ -31,7 +31,7 @@ from ._custom_undefined import CustomUndefined
|
|
|
31
31
|
|
|
32
32
|
@dataclass
|
|
33
33
|
class Builder:
|
|
34
|
-
_snapshot_context:
|
|
34
|
+
_snapshot_context: SnapshotContext
|
|
35
35
|
_build_new_value: bool = False
|
|
36
36
|
|
|
37
37
|
def _convert_child(self, v) -> Custom:
|
|
@@ -45,7 +45,7 @@ class Builder:
|
|
|
45
45
|
return value
|
|
46
46
|
|
|
47
47
|
def _customize(self, v, snapshot_value: Custom) -> Custom:
|
|
48
|
-
from inline_snapshot._global_state import state
|
|
48
|
+
from inline_snapshot._core._global_state import state
|
|
49
49
|
|
|
50
50
|
assert not isinstance(v, Custom)
|
|
51
51
|
|
|
@@ -6,8 +6,8 @@ from abc import abstractmethod
|
|
|
6
6
|
from typing import TYPE_CHECKING
|
|
7
7
|
from typing import Generator
|
|
8
8
|
|
|
9
|
-
from inline_snapshot.
|
|
10
|
-
from inline_snapshot.
|
|
9
|
+
from inline_snapshot._core._change import ChangeBase
|
|
10
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
13
|
pass
|
|
@@ -33,7 +33,7 @@ class Custom(ABC):
|
|
|
33
33
|
raise NotImplementedError()
|
|
34
34
|
|
|
35
35
|
@abstractmethod
|
|
36
|
-
def _code_repr(self, context:
|
|
36
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
37
37
|
raise NotImplementedError()
|
|
38
38
|
|
|
39
39
|
def _eval(self):
|
|
@@ -5,8 +5,8 @@ from dataclasses import dataclass
|
|
|
5
5
|
from dataclasses import field
|
|
6
6
|
from typing import Generator
|
|
7
7
|
|
|
8
|
-
from inline_snapshot.
|
|
9
|
-
from inline_snapshot.
|
|
8
|
+
from inline_snapshot._core._change import ChangeBase
|
|
9
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
10
10
|
|
|
11
11
|
from ._custom import Custom
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ from ._custom import Custom
|
|
|
15
15
|
class CustomDefault(Custom):
|
|
16
16
|
value: Custom = field(compare=False)
|
|
17
17
|
|
|
18
|
-
def _code_repr(self, context:
|
|
18
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
19
19
|
yield from () # pragma: no cover
|
|
20
20
|
# this should never be called because default values are never converted into code
|
|
21
21
|
assert False
|
|
@@ -37,7 +37,7 @@ class CustomCall(Custom):
|
|
|
37
37
|
args: list[Custom] = field(compare=False)
|
|
38
38
|
kwargs: dict[str, Custom] = field(compare=False)
|
|
39
39
|
|
|
40
|
-
def _code_repr(self, context:
|
|
40
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
41
41
|
args = []
|
|
42
42
|
for a in self.args:
|
|
43
43
|
code = yield from a._code_repr(context)
|
|
@@ -6,10 +6,10 @@ from dataclasses import dataclass
|
|
|
6
6
|
from functools import cached_property
|
|
7
7
|
from typing import Generator
|
|
8
8
|
|
|
9
|
-
from inline_snapshot.
|
|
10
|
-
from inline_snapshot._change import
|
|
11
|
-
from inline_snapshot.
|
|
12
|
-
from inline_snapshot._utils import clone
|
|
9
|
+
from inline_snapshot._core._change import ChangeBase
|
|
10
|
+
from inline_snapshot._core._change import RequiredImport
|
|
11
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
12
|
+
from inline_snapshot._core._utils import clone
|
|
13
13
|
|
|
14
14
|
from ._custom import Custom
|
|
15
15
|
|
|
@@ -63,7 +63,7 @@ class CustomCode(Custom):
|
|
|
63
63
|
def _map(self, f):
|
|
64
64
|
return f(self.value)
|
|
65
65
|
|
|
66
|
-
def _code_repr(self, context:
|
|
66
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
67
67
|
for imp in self._imports:
|
|
68
68
|
if isinstance(imp, Import):
|
|
69
69
|
yield RequiredImport(flag="fix", file=context.file, module=imp.module)
|
|
@@ -5,8 +5,8 @@ from dataclasses import dataclass
|
|
|
5
5
|
from dataclasses import field
|
|
6
6
|
from typing import Generator
|
|
7
7
|
|
|
8
|
-
from inline_snapshot.
|
|
9
|
-
from inline_snapshot.
|
|
8
|
+
from inline_snapshot._core._change import ChangeBase
|
|
9
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
10
10
|
|
|
11
11
|
from ._custom import Custom
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ class CustomDict(Custom):
|
|
|
19
19
|
def _map(self, f):
|
|
20
20
|
return f({k._map(f): v._map(f) for k, v in self.value.items()})
|
|
21
21
|
|
|
22
|
-
def _code_repr(self, context:
|
|
22
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
23
23
|
values = []
|
|
24
24
|
for k, v in self.value.items():
|
|
25
25
|
key = yield from k._code_repr(context)
|
|
@@ -5,12 +5,12 @@ from pathlib import Path
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
from typing import Generator
|
|
7
7
|
|
|
8
|
-
from inline_snapshot.
|
|
9
|
-
from inline_snapshot._change import
|
|
10
|
-
from inline_snapshot._change import
|
|
11
|
-
from inline_snapshot.
|
|
12
|
-
from inline_snapshot._external.
|
|
13
|
-
from inline_snapshot.
|
|
8
|
+
from inline_snapshot._core._change import ChangeBase
|
|
9
|
+
from inline_snapshot._core._change import ExternalChange
|
|
10
|
+
from inline_snapshot._core._change import RequiredImport
|
|
11
|
+
from inline_snapshot._core._external._external_location import ExternalLocation
|
|
12
|
+
from inline_snapshot._core._external._format._protocol import get_format_handler
|
|
13
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
14
14
|
|
|
15
15
|
from ._custom import Custom
|
|
16
16
|
|
|
@@ -24,8 +24,8 @@ class CustomExternal(Custom):
|
|
|
24
24
|
def _map(self, f):
|
|
25
25
|
return f(self.value)
|
|
26
26
|
|
|
27
|
-
def _code_repr(self, context:
|
|
28
|
-
from inline_snapshot._global_state import state
|
|
27
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
28
|
+
from inline_snapshot._core._global_state import state
|
|
29
29
|
|
|
30
30
|
storage_name = self.storage or state().config.default_storage
|
|
31
31
|
|
|
@@ -5,8 +5,8 @@ from dataclasses import dataclass
|
|
|
5
5
|
from dataclasses import field
|
|
6
6
|
from typing import Generator
|
|
7
7
|
|
|
8
|
-
from inline_snapshot.
|
|
9
|
-
from inline_snapshot.
|
|
8
|
+
from inline_snapshot._core._change import ChangeBase
|
|
9
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
10
10
|
|
|
11
11
|
from ._custom import Custom
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ class CustomSequence(Custom, CustomSequenceTypes):
|
|
|
24
24
|
def _map(self, f):
|
|
25
25
|
return f(self.value_type([x._map(f) for x in self.value]))
|
|
26
26
|
|
|
27
|
-
def _code_repr(self, context:
|
|
27
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
28
28
|
values = []
|
|
29
29
|
for v in self.value:
|
|
30
30
|
value = yield from v._code_repr(context)
|
|
@@ -54,7 +54,7 @@ class CustomSet(CustomSequence):
|
|
|
54
54
|
braces = "{}"
|
|
55
55
|
trailing_comma = False
|
|
56
56
|
|
|
57
|
-
def _code_repr(self, context:
|
|
57
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
58
58
|
if len(self.value) == 0:
|
|
59
59
|
return "set()"
|
|
60
60
|
values = []
|
|
@@ -2,9 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import Generator
|
|
4
4
|
|
|
5
|
-
from inline_snapshot.
|
|
6
|
-
from inline_snapshot.
|
|
7
|
-
from inline_snapshot.
|
|
5
|
+
from inline_snapshot._core._change import ChangeBase
|
|
6
|
+
from inline_snapshot._core._sentinels import undefined
|
|
7
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
8
8
|
|
|
9
9
|
from ._custom import Custom
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ class CustomUndefined(Custom):
|
|
|
13
13
|
def __init__(self):
|
|
14
14
|
self.value = undefined
|
|
15
15
|
|
|
16
|
-
def _code_repr(self, context:
|
|
16
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
17
17
|
yield from ()
|
|
18
18
|
return "..."
|
|
19
19
|
|
|
@@ -4,8 +4,8 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
from typing import Generator
|
|
6
6
|
|
|
7
|
-
from inline_snapshot.
|
|
8
|
-
from inline_snapshot.
|
|
7
|
+
from inline_snapshot._core._change import ChangeBase
|
|
8
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
9
9
|
|
|
10
10
|
from ._custom import Custom
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ class CustomUnmanaged(Custom):
|
|
|
15
15
|
value: Any
|
|
16
16
|
|
|
17
17
|
def _code_repr(
|
|
18
|
-
self, context:
|
|
18
|
+
self, context: SnapshotContext
|
|
19
19
|
) -> Generator[ChangeBase, None, str]: # pragma: no cover
|
|
20
20
|
yield from ()
|
|
21
21
|
return "'unmanaged'"
|
|
@@ -2,9 +2,9 @@ from dataclasses import dataclass
|
|
|
2
2
|
from typing import Any
|
|
3
3
|
from typing import Generator
|
|
4
4
|
|
|
5
|
-
from inline_snapshot.
|
|
6
|
-
from inline_snapshot.
|
|
7
|
-
from inline_snapshot.
|
|
5
|
+
from inline_snapshot._core._change import ChangeBase
|
|
6
|
+
from inline_snapshot._core._customize._custom import Custom
|
|
7
|
+
from inline_snapshot._core._snapshot_context import SnapshotContext
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@dataclass(frozen=True, eq=False)
|
|
@@ -17,7 +17,7 @@ class Uncustomized(Custom):
|
|
|
17
17
|
def _map(self, f):
|
|
18
18
|
return self._value
|
|
19
19
|
|
|
20
|
-
def _code_repr(self, context:
|
|
20
|
+
def _code_repr(self, context: SnapshotContext) -> Generator[ChangeBase, None, str]:
|
|
21
21
|
assert False
|
|
22
22
|
return "<uncustomized>"
|
|
23
23
|
yield
|