Skip to content

Several tests fail with Pydantic 1.10.15 (latest 1.x) #3600

Closed
@musicinmybrain

Description

@musicinmybrain

Description

Pydantic 1.10.15 aliases the pydantic namespace as pydantic.v1 as a forward-compatibility feature. This seems to interact badly with several

Steps to reproduce

$ gh repo clone aws/serverless-application-model
$ cd serverless-application-model
$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install -e .[dev]
(_e) $ pip install pydantic==1.10.15
(_e) $ make test

Observed result

=========================================================================================== short test summary info ============================================================================================
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_empty_properties - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_invalid_permission - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_with_invalid_permission_type - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/model/test_resource_validator.py::TestResourceValidatorFailure::test_connector_without_source - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
FAILED tests/translator/test_translator.py::test_transform_invalid_document[error_graphqlapi] - AttributeError: module 'pydantic.v1' has no attribute 'error_wrappers'
============================================================================= 5 failed, 3967 passed, 5 rerun in 104.48s (0:01:44) =============================================================================

Expected result

(_e) $ pip install pydantic==1.10.14
(_e) $ make test
======================================================================================= 3972 passed in 103.63s (0:01:43) =======================================================================================

Additional environment details

  1. OS: Fedora 39 x86_64
  2. If using the SAM CLI, sam --version: N/A
  3. AWS region: N/A

Metadata

Metadata

Assignees

Labels

stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions