Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: minimum python 3.11.1 needed for async unit tests to pass. #1571

Closed
2 tasks done
tpsjr7 opened this issue May 3, 2024 · 3 comments
Closed
2 tasks done

[Bug]: minimum python 3.11.1 needed for async unit tests to pass. #1571

tpsjr7 opened this issue May 3, 2024 · 3 comments
Labels
bug Something isn't working severity:low Minor issues or affecting single user Stale Inactive for 30 days

Comments

@tpsjr7
Copy link

tpsjr7 commented May 3, 2024

Is there an existing issue for the same bug?

Describe the bug

poetry run pytest ./tests/unit/ can skips async io tests on the latest version of pytest-asyncio due to a bug in that library.
I suggest pinning pytest-asyncio = "0.21.1" according to this open issue pytest-dev/pytest-asyncio#810

Current Version

0.4.1

Installation and Configuration

poetry run pytest ./tests/unit/

Model and Agent

any

Reproduction Steps

  • git checkout 0.4.1
  • make build
  • observe that pytest-asyncio = 0.23.6 in poetry.lock
  • intentionally create a failure on a test that is marked @pytest.mark.asyncio such as in test_action_github.py
  • poetry run pytest ./tests/unit/test_action_github.py
  • observe that it skips tests but still passes
tests/unit/test_action_github.py::test_run_pull_request_creation_failed
  /home/user/.cache/pypoetry/virtualenvs/opendevin-rh7WTFfU-py3.11/lib/python3.11/site-packages/_pytest/python.py:151: 

PytestUnhandledCoroutineWarning: async def functions are not natively supported and have been skipped.
  You need to install a suitable plugin for your async framework, for example:
    - anyio
    - pytest-asyncio
    - pytest-tornasync
    - pytest-trio
    - pytest-twisted
    warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid)))

That message about "installing a suitable plugin" is a red herring that goes away if you use pytest-asyncio=0.21.1 instead.

Logs, Errors, Screenshots, and Additional Context

No response

@tpsjr7 tpsjr7 added the bug Something isn't working label May 3, 2024
@tpsjr7 tpsjr7 changed the title [Bug]: pytest false positive due to pytest-asyncio bug [Bug]: pytest false positive pass due to pytest-asyncio bug May 3, 2024
@tpsjr7
Copy link
Author

tpsjr7 commented May 4, 2024

I discovered that the root cause of this bug was caused with an interaction with this other bug with Python itself, pytest-dev/pytest-asyncio#403 (comment)

I was using a fresh install of Ubuntu 22.04.4 LTS which was using python 3.11.0rc . The issue mentions it was fixed in 3.11.1. So, when I upgraded to python 3.11.9 this bug went away.

So I actually recommend python = "^3.11.1" in the pyproject.toml instead of python = "^3.11" and leaving pytest-asyncio = '*' as currently is.

I'm not sure of what minimum 3.12 might be required.

@tpsjr7 tpsjr7 changed the title [Bug]: pytest false positive pass due to pytest-asyncio bug [Bug]: minimum python 3.11.1 needed for async unit tests to pass. May 4, 2024
@rbren rbren added the severity:low Minor issues or affecting single user label May 5, 2024
Copy link
Contributor

github-actions bot commented Jun 4, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Inactive for 30 days label Jun 4, 2024
Copy link
Contributor

This issue was closed because it has been stalled for over 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:low Minor issues or affecting single user Stale Inactive for 30 days
Projects
None yet
Development

No branches or pull requests

2 participants