diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-28 13:09:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-29 09:05:10 +0100 |
commit | f2aca4e038888b32650027b5c7d67eda69a8fd48 (patch) | |
tree | 2c3ab1ebeefb2810bd9c45e30fd2b2e9edf003f5 /unotest | |
parent | 4229467fa8528531dc27784f07bc54488c0d2fa9 (diff) |
python test shutdown robustness
so when a test fails, we don't get spurious additional stacktraces
Change-Id: Id2885be9ca628fc25a55f90f6c5c1b50f887a37a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104928
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotest')
-rw-r--r-- | unotest/source/python/org/libreoffice/unotest.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py index 8b421e167c0c..e27f9e145de4 100644 --- a/unotest/source/python/org/libreoffice/unotest.py +++ b/unotest/source/python/org/libreoffice/unotest.py @@ -243,11 +243,12 @@ class UnoInProcess: assert(self.xContext) def tearDown(self): if hasattr(self, 'xDoc'): - self.xDoc.close(True) - # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls - # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be - # garbage-collected after VCL has already been deinitialized: - self.xDoc = None + if self.xDoc: + self.xDoc.close(True) + # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls + # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be + # garbage-collected after VCL has already been deinitialized: + self.xDoc = None def simpleInvoke(connection, test): try: |