Skip to content

Commit 35bfafd

Browse files
authored
Move pytest config to pyproject.toml (#876)
* Move pytest config to pyproject.toml * Fix pytest warning
1 parent 6685c5a commit 35bfafd

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ uninstall:
3636
test:
3737
# Unit tests with coverage report
3838
coverage erase
39-
coverage run -m pytest -c tests/.configs/pytest.ini
39+
coverage run -m pytest
4040
coverage report
4141
coverage html
4242

Diff for: pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,17 @@ ignore = ["tests"]
9999
[tool.pylint.design]
100100
min-public-methods = 0
101101
max-public-methods = 30
102+
103+
[tool.pytest.ini_options]
104+
testpaths = ["tests/unit/"]
105+
asyncio_mode = "auto"
106+
markers = [
107+
"pydantic: Tests with Pydantic as a dependency",
108+
]
109+
filterwarnings = [
110+
"ignore:Module \"dependency_injector.ext.aiohttp\" is deprecated since version 4\\.0\\.0:DeprecationWarning",
111+
"ignore:Module \"dependency_injector.ext.flask\" is deprecated since version 4\\.0\\.0:DeprecationWarning",
112+
"ignore:Please use \\`.*?\\` from the \\`scipy.*?\\`(.*?)namespace is deprecated\\.:DeprecationWarning",
113+
"ignore:Please import \\`.*?\\` from the \\`scipy(.*?)\\` namespace(.*):DeprecationWarning",
114+
"ignore:\\`scipy(.*?)\\` is deprecated(.*):DeprecationWarning",
115+
]

Diff for: tests/.configs/pytest.ini

-13
This file was deleted.

Diff for: tests/unit/ext/test_flask_py2_py3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def index():
1111
return "Hello World!"
1212

1313

14-
def test():
14+
def _test():
1515
return "Test!"
1616

1717

@@ -25,7 +25,7 @@ class ApplicationContainer(containers.DeclarativeContainer):
2525
app = flask.Application(Flask, __name__)
2626

2727
index_view = flask.View(index)
28-
test_view = flask.View(test)
28+
test_view = flask.View(_test)
2929
test_class_view = flask.ClassBasedView(Test)
3030

3131

Diff for: tox.ini

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ deps=
1919
werkzeug
2020
extras=
2121
yaml
22-
commands = pytest -c tests/.configs/pytest.ini
22+
commands = pytest
2323
python_files = test_*_py3*.py
2424
setenv =
2525
COVERAGE_RCFILE = pyproject.toml
@@ -45,7 +45,7 @@ deps =
4545
boto3
4646
mypy_boto3_s3
4747
werkzeug
48-
commands = pytest -c tests/.configs/pytest.ini -m pydantic
48+
commands = pytest -m pydantic
4949

5050
[testenv:coveralls]
5151
passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_*
@@ -57,7 +57,7 @@ deps=
5757
coveralls>=4
5858
commands=
5959
coverage erase
60-
coverage run -m pytest -c tests/.configs/pytest.ini
60+
coverage run -m pytest
6161
coverage report
6262
coveralls
6363

@@ -74,7 +74,7 @@ deps=
7474
mypy_boto3_s3
7575
extras=
7676
yaml
77-
commands = pytest -c tests/.configs/pytest-py35.ini
77+
commands = pytest
7878

7979

8080
[testenv:pylint]

0 commit comments

Comments
 (0)