Skip to content

Commit 52f6e2e

Browse files
author
Guilhem C
authored
Upgrade pytest to latest version (#111)
* upgrade pytest to latest version * update the contributor guide according to new pytest configuration
1 parent 574ee24 commit 52f6e2e

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

DEVELOP.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ After that, tests can be run with:
117117

118118
::
119119

120-
$ cd tests
121120
$ py.test
122121

122+
Pytest configuration can be found in the ``tool.pytest.ini_options`` table of the ``pyproject.toml`` file.
123+
123124
Enforcing the code style (linting)
124125
------------------------------
125126

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ exclude = '''
2020
)/
2121
'''
2222

23+
[tool.pytest.ini_options]
24+
minversion = "6.0"
25+
addopts = "--capture=sys --showlocals -rxs"
26+
testpaths = [
27+
"tests",
28+
]

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest>=2.7.0
1+
pytest>=6.2.4
22
mock>=1.0.1
33
tox>=1.9.2
44
psycopg2>=2.5.4

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pgspecial.main import PGSpecial
44

55

6-
@pytest.yield_fixture(scope="module")
6+
@pytest.fixture(scope="module")
77
def connection():
88
create_db(TEST_DB_NAME)
99
connection = db_connection(TEST_DB_NAME)

tests/pytest.ini

-2
This file was deleted.

0 commit comments

Comments
 (0)