From 1a8f28b90ae5a8bc6fa883ab14c8d9ec4eff0141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 12 Jul 2019 15:38:04 +0200 Subject: [PATCH] tests: Skip test that require tantivy. --- tests/pan_client_test.py | 6 +++++- tests/store_test.py | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/pan_client_test.py b/tests/pan_client_test.py index 242b2b9..8026cb3 100644 --- a/tests/pan_client_test.py +++ b/tests/pan_client_test.py @@ -19,6 +19,7 @@ from nio import ( from pantalaimon.client import PanClient from pantalaimon.config import ServerConfig from pantalaimon.store import PanStore +from pantalaimon.index import INDEXING_ENABLED TEST_ROOM_ID = "!SVkFJHzfwvuaIEawgC:localhost" TEST_ROOM2 = "!testroom:localhost" @@ -453,7 +454,10 @@ class TestClass(object): await client.loop_stop() - async def test_history_fetching_tasks(self, client, aioresponse): + async def test_history_fetching_tasks(self, client, aioresponse, loop): + if not INDEXING_ENABLED: + pytest.skip("Indexing needs to be enabled to test this") + sync_url = re.compile( r'^https://example\.org/_matrix/client/r0/sync\?access_token=.*' ) diff --git a/tests/store_test.py b/tests/store_test.py index c9a89fb..a8b9946 100644 --- a/tests/store_test.py +++ b/tests/store_test.py @@ -1,11 +1,12 @@ import asyncio import pdb import pprint +import pytest from nio import RoomMessage from conftest import faker -from pantalaimon.index import Index, IndexStore +from pantalaimon.index import INDEXING_ENABLED from pantalaimon.store import FetchTask TEST_ROOM = "!SVkFJHzfwvuaIEawgC:localhost" @@ -95,6 +96,10 @@ class TestClass(object): assert task2 in tasks async def test_new_indexstore(self, tempdir): + if not INDEXING_ENABLED: + pytest.skip("Indexing needs to be enabled to test this") + + from pantalaimon.index import Index, IndexStore loop = asyncio.get_event_loop() store = IndexStore("example", tempdir)