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

Fix DeprecationWarning '@pytest.fixture' #225

Merged
merged 2 commits into from
May 3, 2022
Merged

Conversation

moznuy
Copy link
Contributor

@moznuy moznuy commented May 1, 2022

Fixes #119

  • Add rm -rf tests_sync to make clean
  • Changes in make_sync.py:
    • Move filepaths logic to get_source_filepaths
    • Add remove_strings_from_files function to replace strings in files (I could not make unasync replace @pytest.mark.asyncio because it handles input file as separate tokens: @pytest, mark, asyncio). There is open issue for this: Multitoken substitution python-trio/unasync#74.
    • Call remove_strings_from_files for tests_sync directory
  • Switch to strict asyncio_mode for pytest-asyncio
  • Replace @pytest.fixture for pytest_asyncio.fixture where is necessary.
  • Replace @pytest.mark.asyncio with @py_test_mark_asyncio as per workaround
  • Add replacements to make_sync.py:
    • pytest_asyncio -> pytest (For .fixture)
    • py_test_mark_asyncio -> py_test_mark_sync

There are 2 warnings left, but they are in aioredis/connection.py

@codecov-commenter
Copy link

codecov-commenter commented May 1, 2022

Codecov Report

Merging #225 (85540c0) into main (00ed537) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #225   +/-   ##
=======================================
  Coverage   77.25%   77.25%           
=======================================
  Files          12       12           
  Lines        1165     1165           
=======================================
  Hits          900      900           
  Misses        265      265           
Flag Coverage Δ
unit 77.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aredis_om/connections.py 70.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00ed537...85540c0. Read the comment docs.

@simonprickett simonprickett self-requested a review May 3, 2022 10:00
Copy link
Contributor

@simonprickett simonprickett 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 this, tested locally and looks good to me - I'll merge this.

@simonprickett
Copy link
Contributor

Thanks @moznuy !

@simonprickett simonprickett merged commit 935d53b into redis:main May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix test warnings
3 participants