new core.runner helper to avoid local caching issues w. coverage tests; .settings, apps.dash.tests.ITs.test_wallet_views updated accordingly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
15
src/core/runner.py
Normal file
15
src/core/runner.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import time
|
||||
from django.test.runner import DiscoverRunner
|
||||
|
||||
|
||||
class RobustCompressorTestRunner(DiscoverRunner):
|
||||
def setup_test_environment(self, **kwargs):
|
||||
super().setup_test_environment(**kwargs)
|
||||
from compressor.storage import CompressorFileStorage
|
||||
_orig_save = CompressorFileStorage.save
|
||||
def _robust_save(self, name, content):
|
||||
for _ in range(5):
|
||||
try: return _orig_save(self, name, content)
|
||||
except PermissionError: time.sleep(0.05)
|
||||
raise
|
||||
CompressorFileStorage.save = _robust_save
|
||||
Reference in New Issue
Block a user