Permalink
Browse files

Whoosh tests: use a unique tempdir

This ensures that there's no way for results to persist across runs
and lets the OS clean up the mess if we fail catastrophically

The multiindex and regular whoosh tests will have different prefixes to ease
debugging
  • Loading branch information...
1 parent b7f6782 commit 21bf53b5a6a86b3850cd04e86ff9a53e02110f13 @acdha acdha committed Nov 6, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 tests/multipleindex_settings.py
  2. +2 −2 tests/whoosh_settings.py
@@ -1,4 +1,4 @@
-import os
+from tempfile import mkdtemp
from settings import *
INSTALLED_APPS += [
@@ -12,7 +12,7 @@
},
'whoosh': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
- 'PATH': os.path.join('tmp', 'test_whoosh_query'),
+ 'PATH': mkdtemp(prefix='haystack-multipleindex-whoosh-tests-'),
'EXCLUDED_INDEXES': ['multipleindex.search_indexes.BarIndex'],
},
}
View
@@ -1,3 +1,4 @@
+from tempfile import mkdtemp
import os
from settings import *
@@ -8,8 +9,7 @@
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
- 'PATH': os.path.join('tmp', 'test_whoosh_query'),
+ 'PATH': mkdtemp(prefix='haystack-whoosh-tests-'),
'INCLUDE_SPELLING': True,
- # 'STORAGE': 'ram',
},
}

0 comments on commit 21bf53b

Please sign in to comment.