I want to get unittesting under Travis to work with qgis2web. It works up to a point, but Python access within the plugin to the plugin's own UI seems not to be working. The unittest I am working on is here:
An instance of the problem seems to be in populate_layers_and_groups():
The UI item layers_item is created here:
However, after this function should have added layers as children to this item, childCount() gives 0 in Travis:
Running the plugin in QGIS on my client gives the correct value for this childCount().
So, am I failing to pass a reference to, or inject, the plugin UI in the context of the unittest? If so, how do I fix it? If not, what is the issue?