[Libreoffice-commits] .: 2 commits - test-bugzilla-files/test-bugzilla-files.py
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Feb 18 15:46:08 PST 2013
test-bugzilla-files/test-bugzilla-files.py | 36 ++++++++++-------------------
1 file changed, 13 insertions(+), 23 deletions(-)
New commits:
commit 010acaf43fb399afc3197a11c71cd1dcd139a89c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Feb 19 00:46:07 2013 +0100
handle crash during closing gracefully
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index b69ca49..0eb6074 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -332,8 +332,19 @@ class LoadFileTest:
finally:
if t.is_alive():
t.cancel()
- if xDoc:
- xDoc.close(True)
+ try:
+ if xDoc:
+ xDoc.close(True)
+ except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
+ print("caught UnknownPropertyException while closing")
+ self.state.badFiles.append(self.file)
+ connection.tearDown()
+ connection.setUp()
+ except pyuno.getClass("com.sun.star.lang.DisposedException"):
+ print("caught DisposedException while closing")
+ self.state.badFiles.append(self.file)
+ connection.tearDown()
+ connection.setUp()
print("...done with: " + self.file)
class State:
commit 2937c3994112eb0afb3306f22a554f3e98516d60
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Feb 19 00:40:15 2013 +0100
remove unused PerTestConnection
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index c8690b2..b69ca49 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -171,27 +171,6 @@ class OfficeConnection:
print(command)
os.system(command)
-class PerTestConnection:
- def __init__(self, args):
- self.args = args
- self.connection = None
- def getContext(self):
- return self.connection.xContext
- def setUp(self):
- assert(not(self.connection))
- def preTest(self):
- conn = OfficeConnection(self.args)
- conn.setUp()
- self.connection = conn
- def postTest(self):
- if self.connection:
- try:
- self.connection.tearDown()
- finally:
- self.connection = None
- def tearDown(self):
- assert(not(self.connection))
-
class PersistentConnection:
def __init__(self, args):
self.args = args
More information about the Libreoffice-commits
mailing list