Skip to content

Commit bff5e77

Browse files
committed
Add utf-8 encoding in test_apply_pyproject
1 parent 5b57ac9 commit bff5e77

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def test_apply_pyproject_equivalent_to_setupcfg(url, monkeypatch, tmp_path):
4444
monkeypatch.setattr(expand, "read_attr", Mock(return_value="0.0.1"))
4545
setupcfg_example = retrieve_file(url)
4646
pyproject_example = Path(tmp_path, "pyproject.toml")
47-
toml_config = Translator().translate(setupcfg_example.read_text(), "setup.cfg")
48-
pyproject_example.write_text(toml_config)
47+
setupcfg_text = setupcfg_example.read_text(encoding="utf-8")
48+
toml_config = Translator().translate(setupcfg_text, "setup.cfg")
49+
pyproject_example.write_text(toml_config, encoding="utf-8")
4950

5051
dist_toml = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject_example)
5152
dist_cfg = setupcfg.apply_configuration(makedist(tmp_path), setupcfg_example)
@@ -177,9 +178,9 @@ def _pep621_example_project(
177178
text = text.replace(orig, subst)
178179
pyproject.write_text(text, encoding="utf-8")
179180

180-
(tmp_path / readme).write_text("hello world")
181-
(tmp_path / "LICENSE.txt").write_text("--- LICENSE stub ---")
182-
(tmp_path / "spam.py").write_text(PEP621_EXAMPLE_SCRIPT)
181+
(tmp_path / readme).write_text("hello world", encoding="utf-8")
182+
(tmp_path / "LICENSE.txt").write_text("--- LICENSE stub ---", encoding="utf-8")
183+
(tmp_path / "spam.py").write_text(PEP621_EXAMPLE_SCRIPT, encoding="utf-8")
183184
return pyproject
184185

185186

0 commit comments

Comments
 (0)