#       Licensed to the Apache Software Foundation (ASF) under one
#       or more contributor license agreements.  See the NOTICE file
#       distributed with this work for additional information
#       regarding copyright ownership.  The ASF licenses this file
#       to you under the Apache License, Version 2.0 (the
#       "License"); you may not use this file except in compliance
#       with the License.  You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#       Unless required by applicable law or agreed to in writing,
#       software distributed under the License is distributed on an
#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
#       KIND, either express or implied.  See the License for the
#       specific language governing permissions and limitations
#       under the License.

[pytest]
# see python -W and pytest filterwarnings
# https://docs.python.org/3/library/warnings.html#describing-warning-filters
# https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
filterwarnings =
    # https://github.com/html5lib/html5lib-python/issues/443
    ignore::DeprecationWarning:html5lib.filters.sanitizer

    # don't let us regress on this:
    error:tmpl_context.form_values:DeprecationWarning:tg.wsgiapp
    error::pytest.PytestCollectionWarning

    # other packages' issues:
    #   paste,repoze,sphinxcontrib use pkg_resources.declare_namespace:
    ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning:pkg_resources
    # optional import within passlib
    ignore:'crypt' is deprecated:DeprecationWarning:passlib.utils
    ignore:Accessing argon2.__version__ is deprecated:DeprecationWarning:passlib.handlers.argon2

    # py3.12
    ignore::DeprecationWarning:smtpd

    # py3.13
    ignore:'cgi' is deprecated:DeprecationWarning:webob.compat
    ignore:'cgi' is deprecated:DeprecationWarning:formencode.validators

    # py3.14
    ignore:datetime\.datetime\.utcnow\(\) is deprecated and scheduled for removal.*:DeprecationWarning
    ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated and scheduled for removal.*:DeprecationWarning

    # https://github.com/pallets/jinja/issues/1156
    error:invalid escape sequence::jinja2.lexer

addopts = --pyargs -p no:flaky --tb=short

# our patterns are listed first:  then ".*" and following are defaults from https://github.com/pytest-dev/pytest/blob/main/src/_pytest/main.py#L52
norecursedirs = templates_responsive resources images js data docs public *.egg-info __pycache__ .* *.egg _darcs build CVS dist node_modules venv {arch}

# legacy|xunit1|xunit2
#junit_family = legacy

# no|log|system-out|system-err|out-err|all
junit_logging = all
