changeset 6786:0866bb29f217

tests: don't silence errors while creating test index "Errors should never pass silently." For example, I had the problem, that a previous test did not clean up the lock file for the index_dir, which then caused the future tests to fail. Because the error has been silenced, it took a while until I found the reason.
author domruf <dominikruf@gmail.com>
date Sun, 06 Aug 2017 20:18:37 +0200
parents 0add693c626b
children eb4bdc324875
files kallithea/tests/fixture.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/fixture.py	Thu Jul 27 14:30:44 2017 +0000
+++ b/kallithea/tests/fixture.py	Sun Aug 06 20:18:37 2017 +0200
@@ -411,11 +411,8 @@
     if not os.path.exists(index_location):
         os.makedirs(index_location)
 
-    try:
-        l = DaemonLock(file_=os.path.join(dirname(index_location), 'make_index.lock'))
-        WhooshIndexingDaemon(index_location=index_location,
-                             repo_location=repo_location) \
-            .run(full_index=full_index)
-        l.release()
-    except LockHeld:
-        pass
+    l = DaemonLock(file_=os.path.join(dirname(index_location), 'make_index.lock'))
+    WhooshIndexingDaemon(index_location=index_location,
+                         repo_location=repo_location) \
+        .run(full_index=full_index)
+    l.release()