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
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Documentation = "https://codeentropy.readthedocs.io"
testing = [
"pytest>=9.0,<10.0",
"pytest-cov>=7.0,<8.0",
"pytest-sugar>=1.1,<2.0",
"pytest-modern>=0.7.5,<0.8.0",
]
pre-commit = [
"pre-commit>=3.5.0,<5.0",
Expand All @@ -84,11 +84,16 @@ CodeEntropy = "CodeEntropy.cli:main"
[tool.pytest.ini_options]
testpaths = ["tests"]

addopts = "-vv -ra"
addopts = [
"-vv",
"-ra",
"--cov",
"--cov-report=term-missing",
]

markers = [
"regression: end-to-end regression tests against baselines",
"slow: long-running regression tests (20-30+ minutes)",
"regression: end-to-end regression tests against baselines",
"slow: long-running regression tests (20-30+ minutes)",
]

[tool.ruff]
Expand Down
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import annotations

import sys

import pytest


@pytest.hookimpl(tryfirst=True)
def pytest_configure(config):
"""
Force UTF-8 output for the terminal reporter.

On Windows CI stdout is a pipe using cp1252, and pytest-modern crashes
when it writes characters that cp1252 can't encode. This has to run
before pytest-modern sets up its console.
"""
for stream in (sys.stdout, sys.stderr):
if hasattr(stream, "reconfigure") and stream.encoding.lower() != "utf-8":
stream.reconfigure(encoding="utf-8", errors="backslashreplace")
Loading