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

Move register_assert_rewrite earlier in conftest to fix warnings #10578

Merged
merged 1 commit into from Oct 19, 2023

Conversation

graingert
Copy link
Member

I get the following warnings when running pytest:

conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.dataframe.utils
    pytest.register_assert_rewrite(

conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.bag.utils
    pytest.register_assert_rewrite(

conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.array.utils
    pytest.register_assert_rewrite(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

moving the register_assert_rewrite earlier fixes these warnings

  • Closes #xxxx
  • Tests added / passed
  • Passes pre-commit run --all-files

I get the following warnings when running pytest:
```
conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.dataframe.utils
    pytest.register_assert_rewrite(

conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.bag.utils
    pytest.register_assert_rewrite(

conftest.py:90
  /home/graingert/projects/dask/conftest.py:90: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dask.array.utils
    pytest.register_assert_rewrite(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
```

moving the register_assert_rewrite earlier fixes these warnings
@jrbourbeau jrbourbeau changed the title move register_assert_rewrite earlier in conftest to fix warnings Move register_assert_rewrite earlier in conftest to fix warnings Oct 19, 2023
@jrbourbeau jrbourbeau merged commit c644bb5 into dask:main Oct 19, 2023
25 checks passed
@graingert graingert deleted the fix-pytest-warnings branch October 19, 2023 14:28
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.

None yet

2 participants