<div dir="ltr"><div dir="ltr">Hi Alex,</div><div dir="ltr"><br></div><div>Thanks for checking<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 25 juin 2019 à 16:02, Alexandre Neto <<a href="mailto:senhor.neto@gmail.com">senhor.neto@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I have tried locally, and I got no failures on the 51 tests.</div><div><br></div><div>There error is:<br><br><pre id="gmail-m_7533323397275402007gmail-log" class="gmail-m_7533323397275402007gmail-ansi"><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12600">Document: docs/pyqgis_developer_cookbook/cheat_sheet</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12601">----------------------------------------------------</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12602">Application path not initialized</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12603">**********************************************************************</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12604">File "docs/pyqgis_developer_cookbook/cheat_sheet.rst", line 297, in default</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12605">Failed example:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12606"> layers_names = []</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12607"> for layer in QgsProject.instance().mapLayers().values():</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12608"> layers_names.append(<a href="http://layer.name" target="_blank">layer.name</a>())</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12609"></span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12610"> print("layers TOC = {}".format(layers_names))</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12611">Expected:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12612"> layers TOC = ['layer name you like']</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12613">Got:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12614"> layers TOC = ['Companies', 'layer name you like']</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12615">**********************************************************************</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12616">File "docs/pyqgis_developer_cookbook/cheat_sheet.rst", line 327, in default</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12617">Failed example:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12618"> layers_names = [<a href="http://layer.name" target="_blank">layer.name</a>() for layer in QgsProject.instance().mapLayers().values()]</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12619"> print("layers TOC = {}".format(layers_names))</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12620">Expected:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12621"> layers TOC = ['layer name you like']</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12622">Got:</span></div><div class="gmail-m_7533323397275402007gmail-log-line"><span id="gmail-m_7533323397275402007gmail-0-12623"> layers TOC = ['Companies', 'layer name you like']</span></div></pre></div><div><br></div><div>It seems that the 'Companies' layer is added to the TOC in <a href="https://github.com/qgis/QGIS-Documentation/blob/6234bdcece8d5d94eb5acf7802dac13b289d65db/source/docs/pyqgis_developer_cookbook/expressions.rst#L151" target="_blank">https://github.com/qgis/QGIS-Documentation/blob/6234bdcece8d5d94eb5acf7802dac13b289d65db/source/docs/pyqgis_developer_cookbook/expressions.rst#L151</a> <br></div><div><br></div><div>I bet the reason why sometimes it fails, and sometimes it doesn't is because doctest may not always follow the same order. Since we only want to test RST by RST, I think we should do some kind of sanitization at the end of each file.</div><div><br></div></div></blockquote><div>How do we do this sanitization? <br></div><div>In the commit you mention, which aimed to fix that issue (PR with discussion at <a href="https://github.com/qgis/QGIS-Documentation/pull/3869">https://github.com/qgis/QGIS-Documentation/pull/3869</a>), I put the codes in a .. testcode:: group, thinking that will bound the 'Companies' layer creation to that group only. Obviously a fail (though the build succeeded locally and failed on travis the first time before succeeding two times after close/reopen steps).</div><div>What's the purpose of group, then (<a href="https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html">https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html</a>)?</div><div>The order of doctest may indeed be random since providing the suggested fix also fails (<a href="https://github.com/qgis/QGIS-Documentation/pull/3880">https://github.com/qgis/QGIS-Documentation/pull/3880</a>) with suggesting the current situation. :mad:<br></div><div><br></div><div>Harrissou<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Alex<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 25, 2019 at 11:58 AM DelazJ <<a href="mailto:delazj@gmail.com" target="_blank">delazj@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"><div dir="ltr"><div>Hi,</div><div><br></div><div>For days now, master in QGIS-Documentation is failing [0]. For the same reason, which has nothing to do with the writing system but the testing framework for pyQGIS code. Issue is that the failure does not seeem to be constantly reproducible.</div><div>In the link above, havatv-climbalongline and havatv-pointtolayer are both based on master HEAD and none provides changes to code testing. One is passing and the other one is failing. Actually both are reported failing in doc repository [1]<br></div><div>The fixFailingTest2 branch, also based on master, provides a fix based on the suggestion in Travis message. But it failed, and the suggested solution would be ..... the current master state.</div><div><br></div><div>I'm getting crazy so if someone wants to give it a look and bring the repository to green, it would be nice.<br></div><div><br></div><div></div><div>[0] <a href="https://travis-ci.org/qgis/QGIS-Documentation/branches" target="_blank">https://travis-ci.org/qgis/QGIS-Documentation/branches</a></div><div></div><div> [1] <a href="https://github.com/qgis/QGIS-Documentation/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc" target="_blank">https://github.com/qgis/QGIS-Documentation/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc</a></div><div><br></div><div>Thanks,</div><div>Harrissou<br></div></div>
_______________________________________________<br>
Qgis-community-team mailing list for organizing community resources such as documentation, translation etc..<br>
<a href="mailto:Qgis-community-team@lists.osgeo.org" target="_blank">Qgis-community-team@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/qgis-community-team" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-community-team</a></blockquote></div>
</blockquote></div></div>