diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-09-26 17:49:47 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-09-26 17:49:47 +0200 |
commit | 4bf3b4ee48c4e3556e257aa77940f68c13b05b54 (patch) | |
tree | 5196b4e75a89654bdf3f5127c4cdd09ddef22212 | |
parent | d1fbc5e6231b0aa9d3eeda6fe835f2100efa40d7 (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
-rw-r--r-- | pyuno/qa/pytests/testcollections_base.py | 6 |
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 = [] |