Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Fix test warnings and improve lint configuration #584

Merged
merged 4 commits into from Apr 2, 2022

Conversation

aphedges
Copy link
Contributor

Thanks for submitting a PR!

Please make sure to check for the following items:

  • Add unit tests and integration tests where applicable.
    If you've added an error code or changed an error code behavior,
    you should probably add or change a test case file under tests/test_cases/ and add
    it to the list under tests/test_definitions.py.
    If you've added or changed a command line option,
    you should probably add or change a test in tests/test_integration.py.
  • Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.

Please don't get discouraged as it may take a while to get a review.


I ran the tests locally when I noticed some pytest warnings:

.tox/py36-tests/lib/python3.6/site-packages/_pytest/config/__init__.py:1233
  /Users/ahedges/projects/personal/pydocstyle/.tox/py36-tests/lib/python3.6/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: pep8ignore
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

src/tests/test_integration.py:124
  /Users/ahedges/projects/personal/pydocstyle/src/tests/test_integration.py:124: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    @pytest.yield_fixture(scope="module")

src/tests/test_integration.py:141
  /Users/ahedges/projects/personal/pydocstyle/src/tests/test_integration.py:141: PytestDeprecationWarning: @pytest.yield_fixture is deprecated.
  Use @pytest.fixture instead; they are the same.
    @pytest.yield_fixture(scope="function", params=['ini', 'toml'])

I also saw a Sphinx warning: WARNING: html_static_path entry '/Users/ahedges/projects/personal/pydocstyle/docs/_static' does not exist.

I decided to fix these warnings.

I can add release notes if you want, but I don't think they are needed for this.

Changes

  • Fix pytest deprecation warnings by replacing @pytest.yield_fixture with @pytest.fixture
  • Fix pytest unused configuration option warning by removing pep8ignore
    • It was used by pytest-pep8, which was removed from testing in 0a78a1d.
  • Fix Sphinx warning by commenting out a line similar to nearby options
    • There hasn't been a _static directory since the the line was first added in e8fd68a.
  • Move mypy config from tox.ini to pyproject.toml
    • While this isn't strictly necessary, tox.ini is not one of the places mypy looks for configuration by default, so running mypy by itself was more annoying. The pinned version of mypy supports configuration in pyproject.toml, so it made sense to move it in with the Black and isort configuration.

@aphedges aphedges changed the title Improve testing Fix test warnings Mar 13, 2022
Copy link
Contributor

@Mr-Pepe Mr-Pepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

tox.ini Show resolved Hide resolved
@samj1912 samj1912 changed the title Fix test warnings Fix test warnings and improve lint configuration Apr 2, 2022
@samj1912 samj1912 merged commit 03404c8 into PyCQA:master Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants