LibreOffice Module unotest (master)
1
unotest
source
python
org
libreoffice
unittest.py
Go to the documentation of this file.
1
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2
#
3
# This file is part of the LibreOffice project.
4
#
5
# This Source Code Form is subject to the terms of the Mozilla Public
6
# License, v. 2.0. If a copy of the MPL was not distributed with this
7
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
#
9
10
import
gc
11
import
pyuno
12
import
unittest
13
14
class
LoTestResult
(unittest.TextTestResult):
15
def
stopTestRun
(self):
16
# HACK calling gc.collect() to get rid of as many still existing UNO proxies to
17
# SwXTextDocument and friends as possible; those C++ classes' dtors call
18
# Application::GetSolarMutex via sw::UnoImplPtrDeleter, so the dtors must be called before
19
# DeInitVCL in the call to pyuno.private_deinitTestEnvironment(); any remaining proxies
20
# that are still referenced (UnoInProcess' self.xDoc in
21
# unotest/source/python/org/libreoffice/unotest.py, or per-class variables in the various
22
# PythonTests) need to be individually released (each marked as "HACK" in the code):
23
gc.collect()
24
pyuno.private_deinitTestEnvironment()
25
26
if
__name__ ==
'__main__'
:
27
unittest.main(module=
None
, testRunner=unittest.TextTestRunner(resultclass=LoTestResult))
28
29
# vim: set shiftwidth=4 softtabstop=4 expandtab:
org.libreoffice.unittest.LoTestResult
Definition:
unittest.py:14
org.libreoffice.unittest.LoTestResult.stopTestRun
def stopTestRun(self)
Definition:
unittest.py:15
Generated on Sun Jul 30 2023 04:33:26 for LibreOffice Module unotest (master) by
1.9.3