Skip to content

Conversation

@joao-faria-dev
Copy link

Related issue

Closes #1227

Description

Runpytest_subprocess uses system-installed pytest-asyncio instead of development version, causing typeerror when tests needs to use loop_scope parameter. This PR replaces the usage of Runpytest_subprocess in favor of runpytest

Copy link
Contributor

@seifertm seifertm left a comment

Choose a reason for hiding this comment

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

Thanks for the initiative!

The changes don't quite satisfy all tests. Unfortunately, simply replacing calls to runpytest_subprocess with runpytest is not sufficient. In the past, it was necessary to disable assertion rewriting for some of the tests. I haven't looked at the test errors in this PR in detail, so the solution here may be different.

@joao-faria-dev Could you have another look?

@joao-faria-dev joao-faria-dev force-pushed the fix/replace-runpytest-subprocess branch 2 times, most recently from 4987cec to 22fa51c Compare November 3, 2025 19:56
- runpytest_subprocess uses system-installed pytest-asyncio instead of development version, causing typeerror when tests needs to use loop_scope parameter
- Add pytester.makeini() calls to ensure asyncio_default_fixture_loop_scope
is properly configured in test directories
@joao-faria-dev joao-faria-dev force-pushed the fix/replace-runpytest-subprocess branch from ea5e8ef to f99b678 Compare November 4, 2025 15:28
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.68%. Comparing base (7069b5b) to head (9378937).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1275      +/-   ##
==========================================
+ Coverage   90.53%   93.68%   +3.15%     
==========================================
  Files           2        2              
  Lines         412      412              
  Branches       45       45              
==========================================
+ Hits          373      386      +13     
+ Misses         30       20      -10     
+ Partials        9        6       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seifertm
Copy link
Contributor

seifertm commented Nov 4, 2025

I pushed two commits to fix another couple of tests. Locally, I see DeprecationWarnings on Python 3.14 which are triggered for asyncio.DefaultEventLoopPolicy. I haven't investigated why we don't see the same errors in the CI build. This is not right and we should address it before merging.

In my opinion, the best way to address the deprecation warnings is to run the tests with -W default so that they're not converted to errors. Then, we adjust the test's call to assert_outcomes accordingly, so that it accounts for the warning. Lastly, we should add a call to result.stdout.fnmatch_lines which tests stdout against the expected warning message (i.e. the deprecation of asyncio.DefaultEventLoopPolicy.

These steps need to be done conditionally, though, because they only apply to Python 3.14.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

23 tests fail: TypeError: fixture() got an unexpected keyword argument 'loop_scope'

3 participants