1
0
Fork 0

Merging upstream version 3.2.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 20:40:38 +01:00
parent b0222c2f7f
commit 1f96436375
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
7 changed files with 27 additions and 45 deletions

View file

@ -532,6 +532,16 @@ def test_load_from_filename_file_does_not_exist():
assert excinfo.value.args[0].error_msg == 'does_not_exist does not exist'
def test_load_from_filename_unicode_error(tmp_path):
f = tmp_path.joinpath('f')
f.write_bytes(b'\x98\xae\xfe')
with pytest.raises(Error) as excinfo:
load_from_filename(f, map_required, json.loads, Error)
expected = (f'File {f}', mock.ANY)
_assert_exception_trace(excinfo.value.args[0], expected)
def test_load_from_filename_fails_load_strategy(tmpdir):
f = tmpdir.join('foo.notjson')
f.write('totes not json')