Skip to content

Conversation

@v1ack
Copy link

@v1ack v1ack commented Nov 9, 2025

@v1ack
Copy link
Author

v1ack commented Nov 9, 2025

I'm not sure why test_no_collide was broken, my edited variant passes even on old fastapi==0.112.4, pydantic==2.7.0

),
)
return api_dir
return request.param
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not change the fixture return type.
If you need access to some of the fixture params, you can follow one of the two ways:

  • return a "smart" object and access its attributes
  • create a fixture and access/control params through it

I would prefer the second method for this case:

@pytest.fixture(params=['no-collide', 'collide'])
def api_package_signature(request):
    return request.param

@pytest.fixture()
def api_package(..., api_package_signature):
     ...

else:
assert web_request_ref != mobile_request_ref
assert web_request_ref.split('/')[-1] in schemas
assert mobile_request_ref.split('/')[-1] in schemas
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bring back hard-coded values to make the test clearer about which values are expected?

from pydantic import BaseModel


def test_type_keyword_field(ep, app, app_client):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_type_keyword_field(ep, app, app_client):
def test_py312_type_keyword_field(ep, app, app_client):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants