Skip to content

Commit

Permalink
doc, test: update pytest requirement, drop py.test references
Browse files Browse the repository at this point in the history
This bump to `pytest` is primarily to eliminate some deprecation
warnings from inside of `pytest` itself, but note that this relaxes our
dependency to 2 release fields instead of 3, meaning that we will
automatically get 'minor' upgrades to `pytest` (up to 8.0 exclusive)

As of `pytest` 7.2.0, `py` is no longer in our dependency graph, so we
should not refer to this older and sorta-deprecated library, especially
when invoking `pytest`.
  • Loading branch information
SnoopJ committed Oct 30, 2023
1 parent 86d67b2 commit a4b36fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ lint-type:

.PHONY: test test_norecord test_novcr vcr_rerecord
test:
coverage run -m py.test -v .
coverage run -m pytest -v .

test_norecord:
# error if VCR recording for a web request is missing (useful on CI)
coverage run -m py.test -v . --vcr-record=none
coverage run -m pytest -v . --vcr-record=none

test_novcr:
# disable VCR completely; useful to check if recordings are outdated
coverage run -m py.test -v . --disable-vcr
coverage run -m pytest -v . --disable-vcr

vcr_rerecord:
# clear VCR cassettes and run tests to record fresh ones
rm -rf ./test/vcr/*
coverage run -m py.test -v . --vcr-record=all
coverage run -m pytest -v . --vcr-record=all

.PHONY: coverage_report coverage_html coverages
coverage_report:
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ flake8-import-order
flake8-type-checking; python_version >= '3.8'
# Sphinx theme
furo==2023.9.10
pytest~=7.1.0
pytest~=7.4
pytest-vcr~=1.0.2
requests-mock~=1.9.3
sphinx>=7.1.0,<8; python_version <= '3.8'
Expand Down
2 changes: 1 addition & 1 deletion docs/source/plugin/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Assuming your test files are in the ``test`` folder in your project directory::

You can run your test suite with::

py.test -v test/
pytest -v test/

.. __: https://docs.pytest.org/en/stable/getting-started.html

Expand Down
4 changes: 2 additions & 2 deletions sopel/tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MockIRCServer:
``blocking`` arguments to the instance methods below.
The :class:`~sopel.tests.factories.IRCFactory` factory can be used to
create such mock object, either directly or by using ``py.test`` and the
create such mock object, either directly or by using ``pytest`` and the
:func:`~sopel.tests.pytest_plugin.ircfactory` fixture.
.. versionadded:: 7.1
Expand Down Expand Up @@ -361,7 +361,7 @@ class MockUser:
:param str host: user's host
The :class:`~sopel.tests.factories.UserFactory` factory can be used to
create such mock object, either directly or by using ``py.test`` and the
create such mock object, either directly or by using ``pytest`` and the
:func:`~sopel.tests.pytest_plugin.userfactory` fixture.
"""
def __init__(self, nick=None, user=None, host=None):
Expand Down

0 comments on commit a4b36fb

Please sign in to comment.