Page MenuHomeSoftware Heritage

pytest warnings: add TESTFLAGS for pytest-asyncio to auto
AbandonedPublic

Authored by pratyush on Apr 24 2022, 6:56 AM.

Details

Reviewers
None
Group Reviewers
Reviewers
Required Signatures
L3 Software Heritage Contributor License Agreement, version 1.0
Summary

Attempt to resolve globally during install the asyncio_mode warning

/home/swh/.local/lib/python3.9/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' defa
ult value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytes
t configuration file.                                                                                                   
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

Note: Doesn't take care of current builds. echo "asyncio_mode=auto" >> swh-environment/<repo>/pytest.ini

Test Plan

I have set it to auto rather than strict to prevent any mishaps

Diff Detail

Repository
rDENV Development environment
Branch
fix/pytestasioflags
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 28712
Build 44865: arc lint + arc unit

Event Timeline

Try strict. It should work too, and is more reliable.

And why change Makefile.python, instead of just pytest.ini?

  1. You spoke of strict but then double backed and went hmm when I mentioned py37 being the target otherwise on IRC. I did it according to developer documentation on bullseye 3.9.x and possibly would work on 3.10.4 my local arch machine.
  1. I don't see pytest.ini in the cloned swh-environment. I presumed this Makefile.python sort of generates it during install. Am I misinformed here?
  1. Additionally, since this doesn't probably address current builds I could run mr run echo "asyncio_mode=strict" >> pytest.ini for updating all repos current or if that would not be efficient and/or is recursive/will cause issues then maybe theres some sed command which I can figure out.
  1. You spoke of strict but then double backed and went hmm when I mentioned py37 being the target otherwise on IRC. I did it according to developer documentation on bullseye 3.9.x and possibly would work on 3.10.4 my local arch machine.

How do Python versions affect this?

  1. I don't see pytest.ini in the cloned swh-environment. I presumed this Makefile.python sort of generates it during install. Am I misinformed here?

There is one in each repository

  1. Additionally, since this doesn't probably address current builds I could run mr run <echo >> asyncio_mode=auto/strict for updating all repos current or if that would not be efficient and/or is recursive/will cause issues then maybe theres some sed command which I can figure out.

yes, that's how we do it.

  1. Alright, I'm not sure how it affects it I'll admit that. I just didn't want to break backwards compatibility.
  2. So I will:
    1. Remove these TESTFLAGS from Makefile.python.
    2. Utilize point number 3 to update all the repos individually.

closing this since it's not relevant