Initialize tmpdir.
This commit is contained in:
parent
27c90f07a5
commit
75bbf10d78
1 changed files with 4 additions and 1 deletions
|
@ -39,9 +39,12 @@ class _ComicTester(TestCase):
|
||||||
self.url = self.scraperclass.starter()
|
self.url = self.scraperclass.starter()
|
||||||
# create a temporary directory for images
|
# create a temporary directory for images
|
||||||
self.tmpdir = tempfile.mkdtemp()
|
self.tmpdir = tempfile.mkdtemp()
|
||||||
|
else:
|
||||||
|
self.tmpdir = None
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
shutil.rmtree(self.tmpdir)
|
if self.tmpdir is not None:
|
||||||
|
shutil.rmtree(self.tmpdir)
|
||||||
|
|
||||||
def get_saved_images(self):
|
def get_saved_images(self):
|
||||||
"""Get saved images."""
|
"""Get saved images."""
|
||||||
|
|
Loading…
Reference in a new issue