tests: try to cleanup a bit more

This commit is contained in:
Frédéric Péters 2015-03-02 17:01:00 +01:00
parent c4e4e839ca
commit ebdede76f7
1 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import threading
from wcs import sql
from webtest import TestApp
from quixote import cleanup
from quixote import cleanup, get_publisher
from quixote.wsgi import QWIP
import wcs
@ -33,7 +33,9 @@ def create_temporary_pub(sql_mode=False):
if pytest.config.getoption('without_postgresql_tests'):
pytest.skip("unsupported configuration")
return
cleanup()
if get_publisher():
get_publisher().cleanup()
cleanup()
if sql_mode is False and known_elements.pickle_app_dir:
APP_DIR = known_elements.pickle_app_dir
elif sql_mode is True and known_elements.sql_app_dir:
@ -88,6 +90,8 @@ def create_temporary_pub(sql_mode=False):
return pub
def clean_temporary_pub():
if get_publisher():
get_publisher().cleanup()
if known_elements.pickle_app_dir:
shutil.rmtree(known_elements.pickle_app_dir)
known_elements.pickle_app_dir = None