Skip to content

Unclosed database sqlite3 #694

Closed
Closed
@JCHacking

Description

@JCHacking

Summary

When I run my tests with the following command:

pytest --html=reports/tests/index.html \
       --junit-xml=reports/tests/junit.xml \
       --cov=src \
       --cov-report term \
       --cov-report html \
       --cov-report xml \
       --cov-fail-under=100 \
       -vv

I receive errors such as:

pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Connection object at 0x0000019009A11B70>

If I try the same command but with only 1 cov-report it works fine. And if I put the previous version of pytest also.

Versions

pytest = 8.4.0 # FAIL
pytest = 8.3.5 # WORK
pytest-cov = 6.1.1

Config

pyproject.toml

[tool.coverage.run]
data_file = "reports/coverage/.coverage"
source = ["src"]
concurrency = ["thread", "multiprocessing"]

[tool.coverage.paths]
source = ["src"]

[tool.coverage.report]
show_missing = true
skip_empty = true
exclude_lines = [
    "pragma: no cover",
    "raise NotImplementedError",
    "if TYPE_CHECKING:",
]

[tool.coverage.html]
directory = "reports/coverage"
title = "Coverage for tests"

[tool.coverage.xml]
output = "reports/coverage/coverage.xml"

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
pythonpath = ["src"]
testpaths = ["tests"]
python_classes = ""
filterwarnings = [
  "error",
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions