From 78ab153734b9c4f0c45e6a0c4a9cf90acf37ff7a Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 2 Jul 2019 12:00:52 +0200 Subject: [PATCH] Fixed flaky tests because of license cache --- api/tests/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/tests/conftest.py b/api/tests/conftest.py index a1baedcc6..d87e39374 100644 --- a/api/tests/conftest.py +++ b/api/tests/conftest.py @@ -29,6 +29,7 @@ from rest_framework.test import APIClient, APIRequestFactory from funkwhale_api.activity import record from funkwhale_api.federation import actors +from funkwhale_api.music import licenses pytest_plugins = "aiohttp.pytest_plugin" @@ -422,3 +423,10 @@ def a_responses(): @pytest.fixture def service_actor(db): return actors.get_service_actor() + + +@pytest.fixture(autouse=True) +def clear_license_cache(db): + licenses._cache = None + yield + licenses._cache = None