Skip to content

Move pytest config to pyproject.toml #876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uninstall:
test:
# Unit tests with coverage report
coverage erase
coverage run -m pytest -c tests/.configs/pytest.ini
coverage run -m pytest
coverage report
coverage html

Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,17 @@ ignore = ["tests"]
[tool.pylint.design]
min-public-methods = 0
max-public-methods = 30

[tool.pytest.ini_options]
testpaths = ["tests/unit/"]
asyncio_mode = "auto"
markers = [
"pydantic: Tests with Pydantic as a dependency",
]
filterwarnings = [
"ignore:Module \"dependency_injector.ext.aiohttp\" is deprecated since version 4\\.0\\.0:DeprecationWarning",
"ignore:Module \"dependency_injector.ext.flask\" is deprecated since version 4\\.0\\.0:DeprecationWarning",
"ignore:Please use \\`.*?\\` from the \\`scipy.*?\\`(.*?)namespace is deprecated\\.:DeprecationWarning",
"ignore:Please import \\`.*?\\` from the \\`scipy(.*?)\\` namespace(.*):DeprecationWarning",
"ignore:\\`scipy(.*?)\\` is deprecated(.*):DeprecationWarning",
]
13 changes: 0 additions & 13 deletions tests/.configs/pytest.ini

This file was deleted.

4 changes: 2 additions & 2 deletions tests/unit/ext/test_flask_py2_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index():
return "Hello World!"


def test():
def _test():
return "Test!"


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

index_view = flask.View(index)
test_view = flask.View(test)
test_view = flask.View(_test)
test_class_view = flask.ClassBasedView(Test)


Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ deps=
werkzeug
extras=
yaml
commands = pytest -c tests/.configs/pytest.ini
commands = pytest
python_files = test_*_py3*.py
setenv =
COVERAGE_RCFILE = pyproject.toml
Expand All @@ -45,7 +45,7 @@ deps =
boto3
mypy_boto3_s3
werkzeug
commands = pytest -c tests/.configs/pytest.ini -m pydantic
commands = pytest -m pydantic

[testenv:coveralls]
passenv = GITHUB_*, COVERALLS_*, DEPENDENCY_INJECTOR_*
Expand All @@ -57,7 +57,7 @@ deps=
coveralls>=4
commands=
coverage erase
coverage run -m pytest -c tests/.configs/pytest.ini
coverage run -m pytest
coverage report
coveralls

Expand All @@ -74,7 +74,7 @@ deps=
mypy_boto3_s3
extras=
yaml
commands = pytest -c tests/.configs/pytest-py35.ini
commands = pytest


[testenv:pylint]
Expand Down