Fixing CI/CD issues
Some checks are pending
/ build (macos-latest, 3.8) (push) Waiting to run
/ build (ubuntu-latest, pypy-2.7) (push) Waiting to run
/ build (windows-latest, 3.14) (push) Waiting to run

This commit is contained in:
Miroslav Štampar 2026-06-15 16:09:41 +02:00
parent 403855f701
commit d570f8e91f
4 changed files with 12 additions and 7 deletions

View file

@ -15,6 +15,7 @@ A regression here is a divergence between the API and the report - the exact bug
this design exists to prevent.
"""
import io
import json
import os
import sys
@ -200,7 +201,8 @@ class TestWriteReportJson(_CollectorCase):
os.close(fd)
try:
api.writeReportJson(self.c, path)
loaded = json.load(open(path))
with io.open(path, encoding="utf-8") as f: # explicit UTF-8 + closed handle (no ResourceWarning, no cp1252 on Windows)
loaded = json.load(f)
# core shape == API /scan/<id>/data, plus a meta wrapper
self.assertEqual(sorted(loaded.keys()), ["data", "error", "meta", "success"])
self.assertEqual(loaded["data"][0]["value"], "admin")