fixed all unit tests that failed ruff checks

This commit is contained in:
Jakob Pinterits
2024-05-31 23:08:26 +02:00
parent e322a1928b
commit 085a8c1955
2 changed files with 6 additions and 3 deletions
+5 -3
View File
@@ -72,9 +72,11 @@ def check_with_ruff(source_code: str) -> list[str]:
) as temp_file:
temp_file.write(
f"""
from pathlib import Path as Path
import pathlib
import rio
# Importing `Path` directly causes ruff to complain about a redefinition
Path = pathlib.Path
self = rio.Spacer()
{source_code}
@@ -90,8 +92,8 @@ self = rio.Spacer()
"ruff",
"check",
temp_file.name,
"--output-format",
"json",
"--ignore=E402", # Caused by the injected imports
"--output-format=json",
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,