[html]
directory = .test-results/pytest/cov/
show_contexts = true
skip_covered = false

[paths]
_site-packages-to-src-mapping =
  src
  */src
  *\src
  */lib/python*/site-packages
  */pypy*/site-packages
  *\Lib\site-packages

[report]
# custom excludes extend baselines from coverage + covdefaults
# for reference, see
# coverage: https://coverage.readthedocs.io/en/latest/excluding.html#default-exclusions
# covdefaults: https://github.com/asottile/covdefaults/blob/8d8712c26ad505f1269851a7c8431b8c1fedaa62/covdefaults.py#L86-L105
exclude_also =
  ^\s*raise AssertionError\b
  ^\s*raise NotImplementedError\b
  ^\s*return NotImplemented\b
  ^\s*raise$
  ^if __name__ == ['"]__main__['"]:$
  ^\s*@pytest\.mark\.xfail
  ^\s*if _t\.TYPE_CHECKING:
# fail_under = 100
skip_covered = true
skip_empty = true
show_missing = true

[run]
branch = true
# NOTE: `pytest-cov` no longer measures child processes on its own since
# NOTE: v7. The `multiprocessing` concurrency makes the processes started
# NOTE: via the `multiprocessing` module record coverage and save it once
# NOTE: they finish. Setting `concurrency` replaces its default, so
# NOTE: `thread` is listed explicitly to keep measuring threads.
#
# Ref:
# * https://pytest-cov.rtfd.io/en/latest/subprocess-support.html
# * https://coverage.rtfd.io/en/latest/subprocess.html
concurrency =
  multiprocessing
  thread
# NOTE: Coveragepy is incompatible with dynamic context that gets enabled via
# NOTE: `pytest-cov` through a CLI arg to pytest. Refs:
# * https://github.com/aio-libs/multidict/pull/1393
# * https://github.com/pytest-dev/pytest-cov/issues/755
# * https://coverage.rtfd.io/en/latest/changes.html#version-7-15-3-2026-08-02
# * https://github.com/coveragepy/coveragepy/issues/2200
# * https://github.com/coveragepy/coveragepy/pull/2234
core = ${COVERAGE_CORE-ctrace}
cover_pylib = false
# NOTE: `disable_warnings` is needed when `pytest-cov` runs in tandem
# NOTE: with `pytest-xdist`. These warnings are false negative in this
# NOTE: context.
#
# NOTE: It's `coveragepy` that emits the warnings and previously they
# NOTE: wouldn't get on the radar of `pytest`'s `filterwarnings`
# NOTE: mechanism. This changed, however, with `pytest >= 8.4`. And
# NOTE: since we set `filterwarnings = error`, those warnings are being
# NOTE: raised as exceptions, cascading into `pytest`'s internals and
# NOTE: causing tracebacks and crashes of the test sessions.
#
# Ref:
# * https://github.com/pytest-dev/pytest-cov/issues/693
# * https://github.com/pytest-dev/pytest-cov/pull/695
# * https://github.com/pytest-dev/pytest-cov/pull/696
disable_warnings =
  module-not-measured
# https://coverage.rtfd.io/en/latest/contexts.html#dynamic-contexts
# dynamic_context = test_function  # conflicts with `pytest-cov` if set here
# NOTE: Each process writes its own data file, and `pytest-cov` combines
# NOTE: them in the end.
parallel = true
plugins =
#   covdefaults
  Cython.Coverage
relative_files = true
source =
  .
source_pkgs =
  pylibsshext
