summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-26 17:49:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-26 17:49:47 +0200
commit4bf3b4ee48c4e3556e257aa77940f68c13b05b54 (patch)
tree5196b4e75a89654bdf3f5127c4cdd09ddef22212 /pyuno
parentd1fbc5e6231b0aa9d3eeda6fe835f2100efa40d7 (diff)
Call pyuno.private_initTestEnvironment() only once
...instead of once for each class derived from CollectionsTestBase (as listed in pyuno/PythonTest_pyuno_pytests_testcollections.mk), causing the assert(!pSVData->maDeInitHook.IsSet()); in Application::setDeInitHook (vcl/source/app/svapp.cxx) to fire. This is probably far from being idiomatic Python code... Change-Id: I8cd1470c085b16b7b82468a308cfd1dead2db034
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/qa/pytests/testcollections_base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pyuno/qa/pytests/testcollections_base.py b/pyuno/qa/pytests/testcollections_base.py
index b3fcd2eb92f8..d3e8068820cf 100644
--- a/pyuno/qa/pytests/testcollections_base.py
+++ b/pyuno/qa/pytests/testcollections_base.py
@@ -13,13 +13,17 @@ import uno
from org.libreoffice.unotest import pyuno
from com.sun.star.beans import PropertyValue
+testEnvironmentInitialized = False
class CollectionsTestBase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.context = pyuno.getComponentContext()
- pyuno.private_initTestEnvironment()
+ global testEnvironmentInitialized
+ if not testEnvironmentInitialized:
+ pyuno.private_initTestEnvironment()
+ testEnvironmentInitialized = True
def setUp(self):
self._components = []