diff --git a/tests/couch/test_atomicity.py b/tests/couch/test_atomicity.py index 48e1c01d7b9a6dd3ec79f6a744ac78b46ec2fb47..05932abf7a14c990a2c43801f3a2cd3b2fc147e7 100644 --- a/tests/couch/test_atomicity.py +++ b/tests/couch/test_atomicity.py @@ -41,6 +41,7 @@ from test_soledad.u1db_tests import TestCaseWithServer REPEAT_TIMES = 20 +@pytest.mark.needs_couch @pytest.mark.usefixtures('method_tmpdir') class CouchAtomicityTestCase(CouchDBTestCase, TestCaseWithServer): diff --git a/tests/couch/test_backend.py b/tests/couch/test_backend.py index 9dfa22acd079be3336ce230f600452298729f502..7e9bf92190d1d64de18f1c23f5103e9d1732d850 100644 --- a/tests/couch/test_backend.py +++ b/tests/couch/test_backend.py @@ -18,6 +18,7 @@ Test ObjectStore and Couch backend bits. """ +import pytest from uuid import uuid4 from six.moves.urllib.parse import urljoin from testscenarios import TestWithScenarios @@ -35,6 +36,7 @@ from .common import COUCH_SCENARIOS # The following tests come from `u1db.tests.test_common_backend`. # ----------------------------------------------------------------------------- +@pytest.mark.needs_couch class TestCouchBackendImpl(CouchDBTestCase): def test__allocate_doc_id(self): @@ -53,12 +55,14 @@ class TestCouchBackendImpl(CouchDBTestCase): # The following tests come from `u1db.tests.test_backends`. # ----------------------------------------------------------------------------- +@pytest.mark.needs_couch class CouchTests( TestWithScenarios, test_backends.AllDatabaseTests, CouchDBTestCase): scenarios = COUCH_SCENARIOS +@pytest.mark.needs_couch class CouchBackendTests( TestWithScenarios, test_backends.LocalDatabaseTests, @@ -67,6 +71,7 @@ class CouchBackendTests( scenarios = COUCH_SCENARIOS +@pytest.mark.needs_couch class CouchValidateGenNTransIdTests( TestWithScenarios, test_backends.LocalDatabaseValidateGenNTransIdTests, @@ -75,6 +80,7 @@ class CouchValidateGenNTransIdTests( scenarios = COUCH_SCENARIOS +@pytest.mark.needs_couch class CouchValidateSourceGenTests( TestWithScenarios, test_backends.LocalDatabaseValidateSourceGenTests, @@ -83,6 +89,7 @@ class CouchValidateSourceGenTests( scenarios = COUCH_SCENARIOS +@pytest.mark.needs_couch class CouchWithConflictsTests( TestWithScenarios, test_backends.LocalDatabaseWithConflictsTests, @@ -103,6 +110,7 @@ class CouchWithConflictsTests( # test_backends.DatabaseIndexTests.tearDown(self) +@pytest.mark.needs_couch class DatabaseNameValidationTest(unittest.TestCase): def test_database_name_validation(self): diff --git a/tests/couch/test_command.py b/tests/couch/test_command.py index 5271906574d783578492bb7aed422d8ba0845e56..10506e4bf0597f340ac93f461c0e0a8a185ce08a 100644 --- a/tests/couch/test_command.py +++ b/tests/couch/test_command.py @@ -1,3 +1,4 @@ +import pytest from twisted.trial import unittest from leap.soledad.common.couch import state as couch_state @@ -6,6 +7,7 @@ from leap.soledad.common.l2db import errors as u1db_errors from mock import Mock +@pytest.mark.needs_couch class CommandBasedDBCreationTest(unittest.TestCase): def test_ensure_db_using_custom_command(self): diff --git a/tests/couch/test_ddocs.py b/tests/couch/test_ddocs.py index 3937f2de72f5f18ebd54759b6db5a65217328aef..774e64b7b084b7b8d25cffc0214840b5758fa1a4 100644 --- a/tests/couch/test_ddocs.py +++ b/tests/couch/test_ddocs.py @@ -1,3 +1,4 @@ +import pytest from uuid import uuid4 from leap.soledad.common import couch @@ -5,6 +6,7 @@ from leap.soledad.common import couch from test_soledad.util import CouchDBTestCase +@pytest.mark.needs_couch class CouchDesignDocsTests(CouchDBTestCase): def setUp(self): diff --git a/tests/couch/test_state.py b/tests/couch/test_state.py index 2ebcbcb98ca64b5745cd2b7eccd9a3bacbc86c20..1e5d72418786745896f18013c686aa6cd188f97b 100644 --- a/tests/couch/test_state.py +++ b/tests/couch/test_state.py @@ -25,6 +25,7 @@ def restricted_listing(function): return _set_list +@pytest.mark.needs_couch class CouchStateTests(CouchDBTestCase): def setUp(self): diff --git a/tests/couch/test_sync.py b/tests/couch/test_sync.py index c353518e007689a2781ae6a1cfa66bd60e9a5545..bb30847b005916d394e3e9ea49b81b30e6243390 100644 --- a/tests/couch/test_sync.py +++ b/tests/couch/test_sync.py @@ -1,3 +1,4 @@ +import pytest from leap.soledad.common.l2db import vectorclock from leap.soledad.common.l2db import errors as u1db_errors @@ -24,6 +25,7 @@ for name, scenario in COUCH_SCENARIOS: # The following tests come from `u1db.tests.test_sync`. # ----------------------------------------------------------------------------- +@pytest.mark.needs_couch class CouchBackendSyncTests( TestWithScenarios, DatabaseBaseTests, diff --git a/tests/couch/test_sync_target.py b/tests/couch/test_sync_target.py index 0370a6d1fc4b1abf572ed98f8a6106c3b8cfbcef..fcbc866aca72327b4323544a58fb859065a2e258 100644 --- a/tests/couch/test_sync_target.py +++ b/tests/couch/test_sync_target.py @@ -1,4 +1,5 @@ import json +import pytest from leap.soledad.common.l2db import SyncTarget from leap.soledad.common.l2db import errors as u1db_errors @@ -19,6 +20,7 @@ target_scenarios = [ ('local', {'create_db_and_target': make_local_db_and_target}), ] +@pytest.mark.needs_couch class CouchBackendSyncTargetTests( TestWithScenarios, DatabaseBaseTests, diff --git a/tests/server/test_incoming_server.py b/tests/server/test_incoming_server.py index 16d5d5e6ee5a7376c2db5445b96dc79a904ca30c..5878ef09cdd534927e53f948d58fc37466c6257f 100644 --- a/tests/server/test_incoming_server.py +++ b/tests/server/test_incoming_server.py @@ -36,6 +36,7 @@ from test_soledad.util import CouchServerStateForTests from test_soledad.util import CouchDBTestCase +@pytest.mark.needs_couch class IncomingOnCouchServerTestCase(CouchDBTestCase): def setUp(self): diff --git a/tests/server/test_tac.py b/tests/server/test_tac.py index 45bbb1420d8fc0f316a3e54e04dfa3fcd364efda..18cbf20f4ff2e6f75f232058f9a0a90cf61498db 100644 --- a/tests/server/test_tac.py +++ b/tests/server/test_tac.py @@ -36,6 +36,7 @@ from twisted.web.client import Agent TAC_FILE_PATH = resource_filename('leap.soledad.server', 'server.tac') +@pytest.mark.needs_couch @pytest.mark.usefixtures("couch_url") class TacServerTestCase(unittest.TestCase):