From 9cef19d9d2495c9ac70fa81ea19885fc1c979041 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 17 Jul 2021 09:06:16 +0200 Subject: Merging upstream version 3.3.0. Signed-off-by: Daniel Baumann --- tests/cfgv_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/cfgv_test.py b/tests/cfgv_test.py index 7320e4c..15bf581 100644 --- a/tests/cfgv_test.py +++ b/tests/cfgv_test.py @@ -529,7 +529,15 @@ class Error(Exception): def test_load_from_filename_file_does_not_exist(): with pytest.raises(Error) as excinfo: load_from_filename('does_not_exist', map_required, json.loads, Error) - assert excinfo.value.args[0].error_msg == 'does_not_exist does not exist' + assert excinfo.value.args[0].error_msg == 'does_not_exist is not a file' + + +def test_load_from_filename_not_a_file(tmpdir): + with tmpdir.as_cwd(): + tmpdir.join('f').ensure_dir() + with pytest.raises(Error) as excinfo: + load_from_filename('f', map_required, json.loads, Error) + assert excinfo.value.args[0].error_msg == 'f is not a file' def test_load_from_filename_unicode_error(tmp_path): -- cgit v1.2.3