Skip to content

Commit

Permalink
Cleanup after tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvarner committed Jan 30, 2024
1 parent b347506 commit 02456ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

tmp
4 changes: 4 additions & 0 deletions test_app/tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from os.path import join
from shutil import rmtree
import boto3
from django.conf import settings
from django.contrib.admin.sites import AdminSite
Expand Down Expand Up @@ -29,6 +30,9 @@ def setUp(self):
conn = boto3.resource('s3', region_name='us-east-1')
conn.create_bucket(Bucket=settings.INGEST_TRIGGER_BUCKET)

def teardown_class():
rmtree(settings.INGEST_TMP_DIR, ignore_errors=True)

def test_local_admin_save(self):
"""It should add a create a manifest and canvases and delete the Local object"""
local = LocalFactory.build(image_server=self.image_server)
Expand Down
4 changes: 2 additions & 2 deletions test_app/tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def setUp(self):
conn = boto3.resource('s3', region_name='us-east-1')
conn.create_bucket(Bucket=settings.INGEST_TRIGGER_BUCKET)

# def teardown_class():
# rmtree(settings.INGEST_TMP_DIR, ignore_errors=True)
def teardown_class():
rmtree(settings.INGEST_TMP_DIR, ignore_errors=True)

def mock_local(self, bundle, with_manifest=False, metadata={}, from_bulk=False):
# Note, I tried to use the factory here, but could not get it to override the file for bundle.
Expand Down

0 comments on commit 02456ee

Please sign in to comment.