[web/test] don't delete uicache directory
Other tests use it, so the rmtree was a bit too much. Set CACHEDIR to a
temporary subdirectory, and only delete that.
--- a/web/test/unittest_propertysheet.py Fri Feb 20 16:17:51 2015 +0100
+++ b/web/test/unittest_propertysheet.py Wed Jun 11 15:33:09 2014 +0200
@@ -1,13 +1,21 @@
import os
from os.path import join, dirname
from shutil import rmtree
+import errno
+import tempfile
from logilab.common.testlib import TestCase, unittest_main
from cubicweb.web.propertysheet import PropertySheet, lazystr
DATADIR = join(dirname(__file__), 'data')
-CACHEDIR = join(DATADIR, 'uicache')
+
+try:
+ os.makedirs(join(DATADIR, 'uicache'))
+except OSError as err:
+ if err.errno != errno.EEXIST:
+ raise
+CACHEDIR = tempfile.mkdtemp(dir=join(DATADIR, 'uicache'))
class PropertySheetTC(TestCase):