Skip to content

Run pytest with --asyncio-mode=auto#328

Closed
dkaplan1 wants to merge 1 commit into
facebook:mainfrom
dkaplan1:fix_pytest
Closed

Run pytest with --asyncio-mode=auto#328
dkaplan1 wants to merge 1 commit into
facebook:mainfrom
dkaplan1:fix_pytest

Conversation

@dkaplan1
Copy link
Copy Markdown

@dkaplan1 dkaplan1 commented Mar 4, 2022

What:

Updated call to runpytest to use --asyncio-mode=auto.

Why:

Pytest tests are currently failing due to the deprecation warning added to pytest-asyncio in pytest-dev/pytest-asyncio@0a143c4 causing the assertion

assert "passed, 4 errors" in result.stdout.str()
to fail, as the output now contains 23 passed, 1 warning, 4 errors in x.xxs.

Based on https://github.com/pytest-dev/pytest-asyncio#modes I think auto is the correct mode, please let me know if it should be something else.
How:

Adding --asyncio-mode=auto to the pytest run.

Risks:

None that I can think of.

Checklist:

  • Added tests, if you've added code that should be tested
  • Updated the documentation, if you've changed APIs
  • Ensured the test suite passes
  • Made sure your code lints
  • Completed the Contributor License Agreement ("CLA")

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 4, 2022
@facebook-github-bot
Copy link
Copy Markdown

@deathowl has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Apr 14, 2022
…d. (#332)

Summary:
**What:**

CI tests are currently [failing](https://github.com/facebook/TestSlide/actions/runs/2158772378) for Python3.6 with the error:

```
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --asyncio-mode=auto
  inifile: None
```

**Why:**

CI/unit tests are failing for Python3.6.
I believe this failure was introduced with [this](#328) change and [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) seems to be 3.7+ compatible.

**How:**

Do not run pytest with `--asyncio-mode=auto` for Python3.6

**Risks:**

None identified.

**Checklist**:

- [ ] Added tests, if you've added code that should be tested (N/A)
- [ ] Updated the documentation, if you've changed APIs( N/A)
- [X] Ensured the test suite passes
- [X] Made sure your code lints
- [X] Completed the Contributor License Agreement ("CLA")

Pull Request resolved: #332

Reviewed By: cjcon90

Differential Revision: D35643124

Pulled By: deathowl

fbshipit-source-id: 62ed607d51abacce45e37654181907c6a8310501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants