Skip to content

Commit

Permalink
✅ Ensure that warnings are treated as errors (#94)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
  • Loading branch information
Kevin Kirsche and Kludex committed Jul 17, 2023
1 parent 94e281c commit f081901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bump_pydantic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main(
progress.advance(task)

# Visitor logic
code = Path(filename).read_text()
code = Path(filename).read_text(encoding="utf8")
module = cst.parse_module(code)
module_and_package = calculate_module_and_package(str(package), filename)

Expand All @@ -109,7 +109,7 @@ def main(

codemods = gather_codemods(disabled=disable)

log_fp = log_file.open("a+")
log_fp = log_file.open("a+", encoding="utf8")
partial_run_codemods = functools.partial(run_codemods, codemods, metadata_manager, scratch, package, diff)
with Progress(*Progress.get_default_columns(), transient=True) as progress:
task = progress.add_task(description="Executing codemods...", total=len(files))
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ target-version = 'py38'

[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = [
# Turn warnings that aren't filtered into exceptions
"error",
"ignore::pytest.PytestUnraisableExceptionWarning"
]

[tool.coverage.run]
branch = true
Expand Down

0 comments on commit f081901

Please sign in to comment.