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: 2 additions & 0 deletions CHANGES/12620.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Moved pytest config from :file:`setup.cfg` to :file:`pytest.ini`
-- by :user:`aiolibsbot`.
110 changes: 110 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
[pytest]
addopts =
# Show 10 slowest invocations:
--durations=10

# Report all the things == -rxXs:
-ra

# Show values of the local vars in errors/tracebacks:
--showlocals

# Fail on config parsing warnings:
# --strict-config

# Fail on non-existing markers:
# * Deprecated since v6.2.0 but may be reintroduced later covering a
# broader scope:
# --strict
# * Exists since v4.5.0 (advised to be used instead of `--strict`):
--strict-markers

# Skip dev_mode/autobahn/internal tests by default; CI opts in explicitly:
-m "not dev_mode and not autobahn and not internal"

# Disable entry-point auto-load, otherwise we miss coverage.
-p no:aiohttp

asyncio_mode = auto

doctest_optionflags = ALLOW_UNICODE ELLIPSIS

# Marks tests with an empty parameterset as xfail(run=False)
empty_parameter_set_mark = xfail

faulthandler_timeout = 30

filterwarnings =
error
ignore:module 'ssl' has no attribute 'OP_NO_COMPRESSION'. The Python interpreter is compiled against OpenSSL < 1.0.0. Ref. https.//docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION:UserWarning
ignore:Unclosed client session <aiohttp.client.ClientSession object at 0x:ResourceWarning
ignore:The loop argument is deprecated:DeprecationWarning:asyncio
ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
# The following deprecation warning is triggered by importing
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
# Deprecation warning emitted by setuptools v67.5.0+ triggered by importing
# `gunicorn.util`.
ignore:pkg_resources is deprecated as an API:DeprecationWarning
# The deprecation warning below is happening under Python 3.11 and
# is fixed by https://github.com/certifi/python-certifi/pull/199. It
# can be dropped with the next release of `certify`, specifically
# `certify > 2022.06.15`.
ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core
# Dateutil deprecation warning already fixed upstream.
# Can be dropped with the next release, `dateutil > 2.8.2`
# https://github.com/dateutil/dateutil/pull/1285
ignore:datetime.*utcfromtimestamp\(\) is deprecated and scheduled for removal:DeprecationWarning:dateutil.tz.tz
# Tracked upstream and waiting for PR review
# https://github.com/spulec/freezegun/issues/508
# https://github.com/spulec/freezegun/pull/511
ignore:datetime.*utcnow\(\) is deprecated and scheduled for removal:DeprecationWarning:freezegun.api
# Weird issue in Python 3.13+ triggered in test_multipart.py
ignore:coroutine method 'aclose' of 'BodyPartReader._decode_content_async' was never awaited:RuntimeWarning
# uvloop 0.22+ accesses the deprecated asyncio.AbstractEventLoopPolicy
# alias, which Python 3.14 marks for removal in 3.16. Drop this when
# uvloop stops touching the deprecated alias.
ignore:'asyncio.AbstractEventLoopPolicy' is deprecated:DeprecationWarning:uvloop

# https://docs.pytest.org/en/stable/usage.html#creating-junitxml-format-files
junit_duration_report = call
# xunit1 contains more metadata than xunit2 so it's better for CI UIs:
junit_family = xunit1
junit_logging = all
junit_log_passing_tests = true
junit_suite_name = aiohttp_test_suite

# A mapping of markers to their descriptions allowed in strict mode:
markers =
autobahn: Autobahn testsuite. Should be run as a separate job.
dev_mode: mark test to run in dev mode.
internal: tests which may cause issues for packagers, but should be run in aiohttp's CI.
skip_blockbuster: mark test to skip the blockbuster fixture.

minversion = 6.2

# Optimize pytest's lookup by restricting potentially deep dir tree scan:
norecursedirs =
build
dist
docs
requirements
vendor
venv
virtualenv
*.egg-info
.cache
.eggs
.git
.github
.tox
*.egg

testpaths = tests/

# 2-minute per-test timeout so a hung test surfaces by name instead of taking
# down the whole job. Autobahn and benchmark jobs override with `--timeout=0`.
timeout = 120

xfail_strict = true
65 changes: 0 additions & 65 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,68 +38,3 @@ known_first_party=aiohttp,aiohttp_jinja2,aiopg
exclude_lines =
@abc.abstractmethod
@abstractmethod

[tool:pytest]
addopts =
# show 10 slowest invocations:
--durations=10

# a bit of verbosity doesn't hurt:
-v

# report all the things == -rxXs:
-ra

# show values of the local vars in errors:
--showlocals

-m "not dev_mode and not autobahn and not internal"

# Disable entry-point auto-load, otherwise we miss coverage.
-p no:aiohttp
asyncio_mode = auto
# 2-minute per-test timeout so a hung test surfaces by name instead of taking
# down the whole job. Autobahn and benchmark jobs override with `--timeout=0`.
timeout = 120
filterwarnings =
error
ignore:module 'ssl' has no attribute 'OP_NO_COMPRESSION'. The Python interpreter is compiled against OpenSSL < 1.0.0. Ref. https.//docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION:UserWarning
ignore:Unclosed client session <aiohttp.client.ClientSession object at 0x:ResourceWarning
ignore:The loop argument is deprecated:DeprecationWarning:asyncio
ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
# The following deprecation warning is triggered by importing
# `gunicorn.util`. Hopefully, it'll get fixed in the future. See
# https://github.com/benoitc/gunicorn/issues/2840 for detail.
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
# Deprecation warning emitted by setuptools v67.5.0+ triggered by importing
# `gunicorn.util`.
ignore:pkg_resources is deprecated as an API:DeprecationWarning
# The deprecation warning below is happening under Python 3.11 and
# is fixed by https://github.com/certifi/python-certifi/pull/199. It
# can be dropped with the next release of `certify`, specifically
# `certify > 2022.06.15`.
ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core
# Dateutil deprecation warning already fixed upstream.
# Can be dropped with the next release, `dateutil > 2.8.2`
# https://github.com/dateutil/dateutil/pull/1285
ignore:datetime.*utcfromtimestamp\(\) is deprecated and scheduled for removal:DeprecationWarning:dateutil.tz.tz
# Tracked upstream and waiting for PR review
# https://github.com/spulec/freezegun/issues/508
# https://github.com/spulec/freezegun/pull/511
ignore:datetime.*utcnow\(\) is deprecated and scheduled for removal:DeprecationWarning:freezegun.api
# Weird issue in Python 3.13+ triggered in test_multipart.py
ignore:coroutine method 'aclose' of 'BodyPartReader._decode_content_async' was never awaited:RuntimeWarning
# uvloop 0.22+ accesses the deprecated asyncio.AbstractEventLoopPolicy
# alias, which Python 3.14 marks for removal in 3.16. Drop this when
# uvloop stops touching the deprecated alias.
ignore:'asyncio.AbstractEventLoopPolicy' is deprecated:DeprecationWarning:uvloop
junit_suite_name = aiohttp_test_suite
norecursedirs = dist docs build .tox .eggs
minversion = 3.8.2
testpaths = tests/
xfail_strict = true
markers =
autobahn: Autobahn testsuite. Should be run as a separate job.
dev_mode: mark test to run in dev mode.
internal: tests which may cause issues for packagers, but should be run in aiohttp's CI.
skip_blockbuster: mark test to skip the blockbuster fixture.
Loading