doc: fix EncodingWarnings in examples (#11158)

Otherwise the warnings show in the regen output.
This commit is contained in:
Ran Benita
2023-07-08 21:40:05 +03:00
committed by GitHub
parent d790e96765
commit b73ec8e5d1
5 changed files with 7 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ class YamlFile(pytest.File):
# We need a yaml parser, e.g. PyYAML.
import yaml
raw = yaml.safe_load(self.path.open())
raw = yaml.safe_load(self.path.open(encoding="utf-8"))
for name, spec in sorted(raw.items()):
yield YamlItem.from_parent(self, name=name, spec=spec)