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?

  • I would like to thank you for your .travis.yml file, I wanted to have travis-ci unit test my plugin GhiniTreePositioner, too, and I did not know where to start. Now I do. thanks. – mariotomo Jan 11 '17 at 19:35
  • The links are down. – banbar Dec 27 '20 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.