Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ This can then be run like so:

```bash
$ pip install tavern[pytest]
$ py.test test_minimal.tavern.yaml -v
$ pytest test_minimal.tavern.yaml -v
=================================== test session starts ===================================
platform linux -- Python 3.5.2, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 -- /home/taverntester/.virtualenvs/tavernexample/bin/python3
cachedir: .pytest_cache
Expand Down
2 changes: 1 addition & 1 deletion docs/source/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ recommended) it is also possible to specify a custom regular expression to match
filenames. For example, if you want to call all of your files
`tavern_test_x.yaml`, `tavern_test_y.yaml`, etc. then use the
`tavern-file-path-regex` option in the configuration file or on the command
line. For example, `py.test --tavern-file-path-regex "tavern_test_.*.yaml"`
line. For example, `pytest --tavern-file-path-regex "tavern_test_.*.yaml"`

**test_name** is, as expected, the name of that test. If the pytest plugin is
being used to run integration tests, this is what the test will show up as in
Expand Down
8 changes: 4 additions & 4 deletions docs/source/core_concepts/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ at the command line using the `--tavern-global-cfg` flag. The variables in
`common.yaml` will then be available for formatting in *all* tests during that
test run.

**NOTE**: `tavern-ci` is just an alias for `py.test` and
**NOTE**: `tavern-ci` is just an alias for `pytest` and
will take the same options.

```
# These will all work
$ tavern-ci --tavern-global-cfg=integration_tests/local_urls.yaml
$ tavern-ci --tavern-global-cfg integration_tests/local_urls.yaml
$ py.test --tavern-global-cfg=integration_tests/local_urls.yaml
$ py.test --tavern-global-cfg integration_tests/local_urls.yaml
$ pytest --tavern-global-cfg=integration_tests/local_urls.yaml
$ pytest --tavern-global-cfg integration_tests/local_urls.yaml
```

It might be tempting to put this in the 'addopts' section of the pytest.ini file
Expand Down Expand Up @@ -417,7 +417,7 @@ every test:
# Note the '--' after all global configuration files are passed, indicating that
# arguments after this are not global config files
$ tavern-ci --tavern-global-cfg common.yaml test_urls.yaml -- test_server.tavern.yaml
$ py.test --tavern-global-cfg common.yaml local_docker_urls.yaml -- test_server.tavern.yaml
$ pytest --tavern-global-cfg common.yaml local_docker_urls.yaml -- test_server.tavern.yaml
```

```ini
Expand Down
2 changes: 1 addition & 1 deletion docs/source/core_concepts/external_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ it is in the Python path. For example, if `utils.py` is in the 'tests' folder,
you will need to run your tests something like (on Linux):

```shell
$ PYTHONPATH=$PYTHONPATH:tests py.test tests/
$ PYTHONPATH=$PYTHONPATH:tests pytest tests/
```

### Checking the response using external functions
Expand Down
4 changes: 2 additions & 2 deletions docs/source/core_concepts/marks.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ of backend processing so we don't want to run it on every test run. This can be
selected like this:

```shell
$ py.test -m "not slow"
$ pytest -m "not slow"
```

Conversely, if we just want to run all tests marked as 'fast', we can do this:

```shell
$ py.test -m "fast"
$ pytest -m "fast"
```

Marks can only be applied to a whole test, not to individual stages (with the
Expand Down
2 changes: 1 addition & 1 deletion docs/source/core_concepts/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ global strictness setting.

```shell
# Enable strict checking for body and headers only
py.test --tavern-strict json:on headers:on redirect_query_params:off -- my_test_folder/
pytest --tavern-strict json:on headers:on redirect_query_params:off -- my_test_folder/
```

#### In the Pytest config file
Expand Down
2 changes: 1 addition & 1 deletion docs/source/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ from Tavern but we have an error in the yaml:
Having full debug output can be a bit too much information, so we set up logging
as above but at the `INFO` level rather than `DEBUG`.

We run this by doing `py.test --tb=short -p no:logging` and get the following
We run this by doing `pytest --tb=short -p no:logging` and get the following
output:

```
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ tests. Otherwise, you will need to point it to the folder containing the integra
`setup.cfg/tox.ini/etc` so that Pytest's collection mechanism knows where to look.

```bash
$ py.test
$ pytest
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.2.0, py-1.4.34, pluggy-0.4.0
rootdir: /home/developer/project/tests, inifile: setup.cfg
Expand Down
2 changes: 1 addition & 1 deletion example/grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The server runs two gRPC endpoints:

2. In another terminal, run the tests:
```bash
py.test -v
pytest -v

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for remaining py.test references in non-markdown files

echo "=== Remaining py.test references in Python files ==="
rg -n 'py\.test' --type=py

echo -e "\n=== Remaining py.test references in config/ini files ==="
rg -n 'py\.test' -g '*.ini' -g '*.cfg'

echo -e "\n=== Remaining py.test references in YAML files ==="
rg -n 'py\.test' --type=yaml

Repository: taverntesting/tavern

Length of output: 457


Update remaining py.test usages in config and CLI help to pytest

  • tox-integration.ini:42 still runs py.test ...; switch to pytest ... to avoid deprecated behaviour and potential breakage.
  • tavern/entry.py:13 still tells users to run py.test --help; update to pytest --help.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@example/grpc/README.md` at line 29, Replace remaining deprecated "py.test"
usages with "pytest": update the test invocation in tox-integration.ini (the
entry currently running "py.test ...") to "pytest ..." and update the CLI/help
text in tavern/entry.py (the string that says "py.test --help") to "pytest
--help"; ensure you change only the command text and keep surrounding formatting
and arguments intact.

```

The test file (`tests/test_grpc.tavern.yaml`) demonstrates:
Expand Down
2 changes: 1 addition & 1 deletion example/mqtt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ The server queries this database when a `GET` request is made to

The tavern test file includes examples of how to test such a setup, using the
keys `mqtt_publish` and `mqtt_response`. Run `docker compose up --build` in one
terminal and run `py.test` in another terminal, and output from the mosquitto
terminal and run `pytest` in another terminal, and output from the mosquitto
MQTT broker, the server, and the listener will be shown inline.