Changeset - 0866bb29f217
[Not reviewed]
default
0 1 0
domruf - 8 years ago 2017-08-06 20:18:37
dominikruf@gmail.com
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.
1 file changed with 5 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/fixture.py
Show inline comments
 
@@ -411,11 +411,8 @@ def create_test_index(repo_location, con
 
    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()
0 comments (0 inline, 0 general)