From 2d6ecff430a6a28f15c6b39e713caff3b80fb2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Sun, 5 Jan 2020 12:04:27 +0100 Subject: [PATCH] tests: Fix the failing test that tries to open an incompatible index version. --- tests/tantivy_test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/tantivy_test.py b/tests/tantivy_test.py index 347baa8..821fa45 100644 --- a/tests/tantivy_test.py +++ b/tests/tantivy_test.py @@ -171,8 +171,14 @@ class TestFromDiskClass(object): # runs from the root directory assert Index.exists(PATH_TO_INDEX) - def test_opens_from_dir(self): - index = Index(schema(), PATH_TO_INDEX, reuse=True) + def test_opens_from_dir_invalid_schema(self): + with pytest.raises(ValueError): + index = Index(schema(), PATH_TO_INDEX, reuse=True) + + def test_opens_from_dir(self, dir_index): + index_dir, _ = dir_index + + index = Index(schema(), str(index_dir), reuse=True) assert index.searcher().num_docs == 3 def test_create_readers(self):