<div dir="ltr"><div>Hi</div><div><br></div><div dir="ltr">The mapCanvas has already been mocked into the testing iface, it should be fairly simple to do the same for the temporal controller.</div><div dir="ltr">See here for reference <a href="https://github.com/qgis/QGIS/blob/master/python/testing/mocked.py#L58-L60">https://github.com/qgis/QGIS/blob/master/python/testing/mocked.py#L58-L60</a></div><div dir="ltr"><br></div><div>To complete the comments by Alessandro, there are also advantages of mocking dependencies, most notably test isolation.</div><div><br></div><div>Regards</div><div>Matthias</div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 12, 2021 at 12:46 PM Alessandro Pasotti <<a href="mailto:apasotti@gmail.com">apasotti@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Jan 12, 2021 at 12:38 PM Richard Duivenvoorde<br>
<<a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a>> wrote:<br>
><br>
> On 1/12/21 12:32 PM, Alessandro Pasotti wrote:<br>
> > On Tue, Jan 12, 2021 at 11:51 AM Richard Duivenvoorde<br>
> >> but... one of my docs (temporal navigator) PR's is still failing:<br>
> >> <a href="https://travis-ci.org/github/qgis/QGIS-Documentation/builds/739861175" rel="noreferrer" target="_blank">https://travis-ci.org/github/qgis/QGIS-Documentation/builds/739861175</a><br>
> >><br>
> >> NOT image related, but if somebody finds some time to check, please let me know what I'm doing wrong.<br>
> >><br>
><br>
> > I think this is None:<br>
> > navigator = iface.mapCanvas().temporalController()<br>
> ><br>
> > I wonder if it would be better to use a full real QGIS for doc<br>
> > testing, the same system we use for plugins testing as explained here:<br>
> > <a href="https://github.com/qgis/QGIS/tree/master/.docker#running-unit-tests-inside-qgis" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/tree/master/.docker#running-unit-tests-inside-qgis</a><br>
><br>
> I thought we did that?<br>
> <a href="https://github.com/qgis/QGIS-Documentation/blob/release_3.16/doctest.dockerfile" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS-Documentation/blob/release_3.16/doctest.dockerfile</a><br>
> don't we use that docker to have a 'real' QGIS?<br>
<br>
We do, but we are running doctests using python directly, not invoking<br>
QGIS and running the tests inside it.<br>
<br>
To elaborate what a "real QGIS" means in this context there are (at<br>
least) two ways of running tests:<br>
<br>
1. the way we use for all Travis CI tests in core: run the tests<br>
directly from python using a mocked QgsApplication and iface, in this<br>
case we are using the "real QGIS" libraries but not the "real QGIS<br>
application"<br>
2. the way I originally developed for Python plugins CI in Boudless<br>
(I'm not using that personally anymore) which was to run Python tests<br>
**inside** a "real QGIS" application.<br>
<br>
The advantage of (2) is that there is no need to mock anything, the<br>
tests are run as if you were inside QGIS and using the QGIS Python<br>
console.<br>
<br>
The disadvantage is that it is slower.<br>
<br>
-- <br>
Alessandro Pasotti<br>
QCooperative:  <a href="http://www.qcooperative.net" rel="noreferrer" target="_blank">www.qcooperative.net</a><br>
ItOpen:   <a href="http://www.itopen.it" rel="noreferrer" target="_blank">www.itopen.it</a><br>
</blockquote></div></div>