passing all tests in thinkpad
This commit is contained in:
@@ -185,16 +185,27 @@ class SessionFactory(factory.DjangoModelFactory):
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def cleanup(request):
|
||||
def remove_test_files():
|
||||
|
||||
for filename in os.listdir('media/mailbox_attachments'):
|
||||
path = os.path.join('media/mailbox_attachments/',filename)
|
||||
if not os.path.isdir(path):
|
||||
os.remove(path)
|
||||
try:
|
||||
for filename in os.listdir('media/mailbox_attachments'):
|
||||
path = os.path.join('media/mailbox_attachments/',filename)
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
for filename in os.listdir('rowers/tests/testdata/temp'):
|
||||
path = os.path.join('rowers/tests/testdata/temp/',filename)
|
||||
if not os.path.isdir(path):
|
||||
os.remove(path)
|
||||
try:
|
||||
for filename in os.listdir('rowers/tests/testdata/temp'):
|
||||
path = os.path.join('rowers/tests/testdata/temp/',filename)
|
||||
if not os.path.isdir(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
request.addfinalizer(remove_test_files)
|
||||
|
||||
Reference in New Issue
Block a user