From 3027b01701d266aeb637e3c68734a91eff0c8986 Mon Sep 17 00:00:00 2001 From: Neeraj Gopalakrishnan <91423180+gneeraj2001@users.noreply.github.com> Date: Fri, 29 Aug 2025 02:39:04 -0700 Subject: [PATCH] Update cognee/tests/test_path_config.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- cognee/tests/test_path_config.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/cognee/tests/test_path_config.py b/cognee/tests/test_path_config.py index 65201fc70..b90ce8cac 100644 --- a/cognee/tests/test_path_config.py +++ b/cognee/tests/test_path_config.py @@ -16,19 +16,12 @@ def test_root_dir_absolute_paths(): # Test with relative path (should fail) rel_path = "relative/path" - try: + with pytest.raises(ValueError, match="must be absolute"): ensure_absolute_path(rel_path, allow_relative=False) - assert False, "Should fail with relative path when allow_relative=False" - except ValueError as e: - assert "must be absolute" in str(e) - - # Test with None path - try: - ensure_absolute_path(None) - assert False, "Should fail with None path" - except ValueError as e: - assert "cannot be None" in str(e) + # Test with None path + with pytest.raises(ValueError, match="cannot be None"): + ensure_absolute_path(None) def test_database_relative_paths(): """Test relative path handling for vector and graph databases""" system_root = "C:/system/root" if os.name == 'nt' else "/system/root"