Sfoglia il codice sorgente

delete test MEDIA_ROOT dir after tests have completed.

master
Victor Munene 6 anni fa
parent
commit
ebde2b6269
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7
    0
      tests/conftest.py

+ 7
- 0
tests/conftest.py Vedi File

@@ -1,4 +1,5 @@
1 1
 import os
2
+import shutil
2 3
 import warnings
3 4
 
4 5
 import django
@@ -31,3 +32,9 @@ def pytest_configure(config):
31 32
         os.environ['DATABASE_NAME'] = ':memory:'
32 33
 
33 34
     django.setup()
35
+
36
+
37
+def pytest_unconfigure(config):
38
+    # remove tests/public/media folder
39
+    from django.conf import settings
40
+    shutil.rmtree(settings.MEDIA_ROOT, ignore_errors=True)

Loading…
Annulla
Salva