Enable retrieval test when executed through Travis cron job

This commit is contained in:
Falco Duersch
2018-10-23 09:12:11 +02:00
parent 8a84651fdc
commit 8b09b81ba3
+7 -1
View File
@@ -18,8 +18,14 @@ def canteen(request):
return request.param
def is_enabled():
user_enabled = bool(os.getenv(ENV_ENABLED))
travis_enabled = os.getenv('TRAVIS_EVENT_TYPE') == 'cron'
return user_enabled or travis_enabled
requires_online_api = pytest.mark.skipif(
not bool(os.getenv(ENV_ENABLED)),
not is_enabled(),
reason='Querying the online API is disabled. Turn on by setting env variable %s.' % ENV_ENABLED
)