Skip to content

Instantly share code, notes, and snippets.

View samaddico's full-sized avatar
🏠
Working from home

Samuel Addico samaddico

🏠
Working from home
View GitHub Profile
@samaddico
samaddico / test_temp_directory.py
Created February 2, 2020 04:00 — forked from odyniec/test_temp_directory.py
An example Python unittest test case that creates a temporary directory before a test is run and removes it when it's done.
import shutil, tempfile
from os import path
import unittest
class TestExample(unittest.TestCase):
def setUp(self):
# Create a temporary directory
self.test_dir = tempfile.mkdtemp()
def tearDown(self):