Skip to content

Commit b0a6689

Browse files
committed
windows test:
* skip options startup test (--help shows a message box on windows) * avoid initial console help (cherry picked from commit 7293c05)
1 parent a1e8d68 commit b0a6689

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tests/src/python/test_console.py

+8
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,24 @@
1313
__revision__ = '$Format:%H$'
1414

1515
import qgis # NOQA
16+
import os
1617

1718
from qgis.testing import unittest, start_app
1819
from console import console
20+
from qgis.PyQt.QtCore import QSettings, QCoreApplication
1921

2022
start_app()
2123

2224

2325
class TestConsole(unittest.TestCase):
2426

2527
def test_show_console(self):
28+
if os.name == 'nt':
29+
QCoreApplication.setOrganizationName("QGIS")
30+
QCoreApplication.setOrganizationDomain("qgis.org")
31+
QCoreApplication.setApplicationName("QGIS-TEST")
32+
QSettings().setValue('pythonConsole/contextHelpOnFirstLaunch', False)
33+
2634
my_console = console.show_console()
2735
my_console_widget = my_console.console
2836

tests/src/python/test_qgsappstartup.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
from qgis.testing import unittest
2929
from utilities import unitTestDataPath
30-
from builtins import str
3130

3231
print('CTEST_FULL_OUTPUT')
3332

@@ -162,8 +161,11 @@ def testPyQgisStartupEnvVar(self):
162161
env={'PYQGIS_STARTUP': testmod})
163162

164163
def testOptionsAsFiles(self):
164+
if os.name == 'nt':
165+
return
166+
165167
# verify QGIS accepts filenames that match options after the special option '--'
166-
# '--help' should return immediatly (after displaying the usage hints)
168+
# '--help' should return immediately (after displaying the usage hints)
167169
# '-- --help' should not exit but try (and probably fail) to load a layer called '--help'
168170
with self.assertRaises(Exception):
169171
self.doTestStartup(option="--configpath",

0 commit comments

Comments
 (0)