Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: async fixtures in conftest.py#2068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kludex merged 2 commits intopydantic:mainfromstevenh:fix/async-fixtures
Jun 26, 2025

Conversation

stevenh
Copy link
Contributor

@stevenhstevenh commentedJun 25, 2025
edited by DouweM
Loading

Explicitly make autouse fixtures async to avoid issues with newer versions of pytest, which made this a warning by default.

Fixes#2065

Explicitly make autouse fixtures async to avoid issues with newerversions of pytest, which made this a warning by default.
@stevenhstevenh marked this pull request as ready for reviewJune 25, 2025 09:52
@Kludex
Copy link
Member

What's the error?

@KludexKludex self-assigned thisJun 25, 2025
@stevenh
Copy link
ContributorAuthor

What's the error?

pytest.PytestRemovedIn9Warning: 'test_init' requested an async fixture 'close_cached_httpx_cl…

It comes from a new validation which I believe was added inpytest 8.4 here.

I tripped over it when developing the AG-UI integration, as uv bumped all the dependencies and all the tests started failing.

Use str for the type hint, avoiding the need for a comment or Literal.
@Kludex
Copy link
Member

You don't need to bump all dependencies when updating the lock file. Let me update pytest here.

@Kludex
Copy link
Member

I've bumpedpytest andanyio, and I can't reproduce it. 🤔

@stevenh
Copy link
ContributorAuthor

You don't need to bump all dependencies when updating the lock file. Let me update pytest here.

Yer, I just tripped over it as I was bouncing between various configs anduv decided it wanted to update all the things.

@stevenh
Copy link
ContributorAuthor

stevenh commentedJun 25, 2025
edited
Loading

It's a bit heavy, but this should trigger a repoduction:

uv add --dev -U  pytest-cov

I'd assumed it was pytest, as it was where the error was coming from, there might be another underlying cause.

In case it helps:

  • anyio = 4.9.0
  • pytest = 8.4.1

@DouweMDouweM mentioned this pull requestJun 25, 2025
2 tasks
@medaminezghal
Copy link
Contributor

@Kludex I've already face the same problem that@stevenh suggest to fix. I've tested its solution and it works well.

@medaminezghal
Copy link
Contributor

@Viicos Would you like to check this PR?

@KludexKludex merged commit967b825 intopydantic:mainJun 26, 2025
18 checks passed
@Kludex
Copy link
Member

I can't really reproduce it... But since the pipeline is passing, let's go.

stevenh reacted with heart emoji

@stevenhstevenh deleted the fix/async-fixtures branchJune 26, 2025 09:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@KludexKludexKludex left review comments

Assignees

@KludexKludex

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Tests errors when using pytest>=8.4.0
3 participants
@stevenh@Kludex@medaminezghal

[8]ページ先頭

©2009-2025 Movatter.jp