Skip to content

Commit

Permalink
doc, test: replace py.test references with pytest
Browse files Browse the repository at this point in the history
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 71ab85d commit bf01a50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 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 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 bf01a50

Please sign in to comment.