utils: Fix coverage pragma location

This commit is contained in:
Florian Bruhin 2021-10-21 18:35:50 +02:00
parent ca114a0766
commit 2d85e41006
1 changed files with 3 additions and 3 deletions

View File

@ -669,12 +669,12 @@ def yaml_load(f: Union[str, IO[str]]) -> Any:
r"of from 'collections\.abc' is deprecated.*"):
try:
data = yaml.load(f, Loader=YamlLoader)
except ValueError as e:
except ValueError as e: # pragma: no cover
pyyaml_error = 'could not convert string to float'
if str(e).startswith(pyyaml_error): # pragma: no cover
if str(e).startswith(pyyaml_error):
# WORKAROUND for https://github.com/yaml/pyyaml/issues/168
raise yaml.YAMLError(e)
raise # pragma: no cover
raise
end = datetime.datetime.now()