mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Fix intermittent QgsMapLayerStore test failure
This commit is contained in:
parent
9ee9df7627
commit
01f12221ad
@ -17,6 +17,7 @@ from qgis.testing import start_app, unittest
|
||||
from qgis.PyQt.QtCore import QT_VERSION_STR
|
||||
import sip
|
||||
from qgis.PyQt.QtTest import QSignalSpy
|
||||
from time import sleep
|
||||
|
||||
start_app()
|
||||
|
||||
@ -201,7 +202,11 @@ class TestQgsMapLayerStore(unittest.TestCase):
|
||||
self.assertEqual(store.mapLayersByName('test2'), [l2])
|
||||
|
||||
#duplicate name
|
||||
|
||||
# little bit of a hack - we don't want a duplicate ID and since IDs are currently based on time we wait a bit here
|
||||
sleep(0.1)
|
||||
l3 = createLayer('test')
|
||||
|
||||
store.addMapLayer(l3)
|
||||
self.assertEqual(set(store.mapLayersByName('test')), {l1, l3})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user