diff --git a/tests/storage/servers/fastmail/__init__.py b/tests/storage/servers/fastmail/__init__.py index a421f92..2678972 100644 --- a/tests/storage/servers/fastmail/__init__.py +++ b/tests/storage/servers/fastmail/__init__.py @@ -3,15 +3,19 @@ import os import pytest +username = os.environ.get('FASTMAIL_USERNAME', '').strip() +password = os.environ.get('FASTMAIL_PASSWORD', '').strip() + + class ServerMixin(object): @pytest.fixture def get_storage_args(self, slow_create_collection): + if not username: + pytest.skip('Fastmail credentials not available') + def inner(collection='test'): - args = { - 'username': os.environ['FASTMAIL_USERNAME'], - 'password': os.environ['FASTMAIL_PASSWORD'] - } + args = {'username': username, 'password': password} if self.storage_class.fileext == '.ics': args['url'] = 'https://caldav.messagingengine.com/' diff --git a/tests/storage/servers/icloud/__init__.py b/tests/storage/servers/icloud/__init__.py index f814490..5c4c45c 100644 --- a/tests/storage/servers/icloud/__init__.py +++ b/tests/storage/servers/icloud/__init__.py @@ -2,6 +2,9 @@ import os import pytest +username = os.environ.get('ICLOUD_USERNAME', '').strip() +password = os.environ.get('ICLOUD_PASSWORD', '').strip() + class ServerMixin(object): @@ -12,11 +15,11 @@ class ServerMixin(object): # See https://github.com/pimutils/vdirsyncer/pull/593#issuecomment-285941615 # noqa pytest.skip('iCloud doesn\'t support anything else than VEVENT') + if not username: + pytest.skip('iCloud credentials not available') + def inner(collection='test'): - args = { - 'username': os.environ['ICLOUD_USERNAME'], - 'password': os.environ['ICLOUD_PASSWORD'] - } + args = {'username': username, 'password': password} if self.storage_class.fileext == '.ics': args['url'] = 'https://caldav.icloud.com/'