tests: Fix the failing test that tries to open an incompatible index version.

master
Damir Jelić 2020-01-05 12:04:27 +01:00
parent 41cdad4157
commit 2d6ecff430
1 changed files with 8 additions and 2 deletions

View File

@ -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):