nickh007 commited on
Commit
a69b31b
·
verified ·
1 Parent(s): 0430042

Give every text read an explicit encoding

Browse files
Files changed (1) hide show
  1. tests/test_conformance.py +3 -3
tests/test_conformance.py CHANGED
@@ -199,8 +199,8 @@ def test_index_matches_the_manifest_exactly():
199
  here = Path(__file__).resolve().parents[1]
200
  idx = here / "data" / "index.jsonl"
201
  assert idx.exists(), "index.jsonl missing -- run build_index.py"
202
- rows = [_json.loads(x) for x in idx.read_text().splitlines() if x.strip()]
203
- man = _json.loads((here / "data" / "manifest.json").read_text())
204
  assert len(rows) == len(man["cases"]) == man["n_cases"]
205
  by_name = {r["name"]: r for r in rows}
206
  for c in man["cases"]:
@@ -222,7 +222,7 @@ def test_readme_flags_the_one_figure_it_cannot_reproduce():
222
  one does not, so the card has to say so -- and the resonator it describes
223
  must actually be passive today, or the anecdote is worse than the bug.
224
  """
225
- readme = (HERE / "README.md").read_text()
226
  assert "1.2441" in readme, "drop this guard along with the figure"
227
  assert "cannot reproduce from the" in readme
228
  assert "superseded generator revision" in readme
 
199
  here = Path(__file__).resolve().parents[1]
200
  idx = here / "data" / "index.jsonl"
201
  assert idx.exists(), "index.jsonl missing -- run build_index.py"
202
+ rows = [_json.loads(x) for x in idx.read_text(encoding="utf-8").splitlines() if x.strip()]
203
+ man = _json.loads((here / "data" / "manifest.json").read_text(encoding="utf-8"))
204
  assert len(rows) == len(man["cases"]) == man["n_cases"]
205
  by_name = {r["name"]: r for r in rows}
206
  for c in man["cases"]:
 
222
  one does not, so the card has to say so -- and the resonator it describes
223
  must actually be passive today, or the anecdote is worse than the bug.
224
  """
225
+ readme = (HERE / "README.md").read_text(encoding="utf-8")
226
  assert "1.2441" in readme, "drop this guard along with the figure"
227
  assert "cannot reproduce from the" in readme
228
  assert "superseded generator revision" in readme