Skip to content

Compatibility issue with Pydantic v2 - TypeError on CoreSettings.default_database_config() #7

@francbartoli

Description

@francbartoli

Description

When using pytest-iam with Pydantic v2, an error occurs during fixture initialization.

Environment

  • Python: 3.12
  • Pydantic: 2.x
  • pytest-iam: latest

Error

TypeError: CoreSettings.default_database_config() missing 1 required positional argument: 'self'

Steps to Reproduce

  1. Install pytest-iam in a project using Pydantic v2
  2. Use the iam fixture in a test
  3. Run pytest

Expected Behavior

The iam fixture should initialize correctly and provide a mock OIDC server.

Actual Behavior

The fixture fails with a TypeError because default_database_config is being called as a class method instead of an instance method.

Related

This appears to be related to Pydantic v2 migration issues. See: pydantic/pydantic#10551

Workaround

Currently using mocked OIDC authentication directly instead of pytest-iam.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions