Skip to content

Commit f6de736

Browse files
committed
Move pytest configuration to native toml
1 parent 3e96db7 commit f6de736

6 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/oldest-postgres.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
- name: Run tests without xdist
6262
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v4.1.1
6363
with:
64-
command: py.test -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml
64+
command: pytest -c oldest/pyproject.toml -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml
6565
- name: Run xdist test
6666
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v4.1.1
6767
with:
68-
command: py.test -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
68+
command: pytest -n auto -c oldest/pyproject.toml --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
6969
- uses: actions/upload-artifact@v5
7070
if: failure()
7171
with:

.github/workflows/single-postgres.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656
- name: Run test
5757
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v4.1.1
5858
with:
59-
command: py.test -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml
59+
command: pytest -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml
6060
- name: Run xdist test
6161
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v4.1.1
6262
with:
63-
command: py.test -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
63+
command: pytest -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
6464
- uses: actions/upload-artifact@v5
6565
if: failure()
6666
with:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Example usage:
254254

255255
.. code-block:: sh
256256
257-
py.test tests --postgresql-port=8888
257+
pytest tests --postgresql-port=8888
258258
259259
260260
* specify your port as ``postgresql_port`` in your ``pytest.ini`` file.

newsfragments/1218.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update pytest configuration to toml-native

oldest/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tool.pytest.ini_options]
2+
xfail_strict=true
3+
addopts = "--showlocals --verbose --cov"
4+
testpaths = "tests"
5+
pytester_example_dir = "tests/examples"
6+
norecursedirs = "../examples"

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ include = ["pytest_postgresql*"]
5656
exclude = ["tests*"]
5757
namespaces = false
5858

59-
[tool.pytest.ini_options]
60-
xfail_strict=true
61-
addopts = "--showlocals --verbose --cov"
62-
testpaths = "tests"
59+
[tool.pytest]
60+
strict_xfail=true
61+
addopts = ["--showlocals", "--verbose", "--cov"]
62+
testpaths = ["tests"]
6363
pytester_example_dir = "tests/examples"
64-
norecursedirs = "examples"
64+
norecursedirs = ["examples"]
6565

6666
[tool.ruff]
6767
line-length = 120

0 commit comments

Comments
 (0)