summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'guide/distutils.html')
-rw-r--r--guide/distutils.html31
1 files changed, 29 insertions, 2 deletions
diff --git a/guide/distutils.html b/guide/distutils.html
index 35bd9c8..c1b7598 100644
--- a/guide/distutils.html
+++ b/guide/distutils.html
@@ -739,7 +739,7 @@ it call <code class="docutils literal notranslate"><span class="pre">distutils-r
<span class="nv">EAPI</span><span class="o">=</span><span class="m">7</span>
<span class="nv">PYTHON_COMPAT</span><span class="o">=(</span> python3_<span class="o">{</span><span class="m">6</span>,7,8<span class="o">}</span> <span class="o">)</span>
- inherit distutils-r1 virtualx
+ inherit distutils-r1
<span class="nv">DESCRIPTION</span><span class="o">=</span><span class="s2">&quot;Extra features for standard library&#39;s cmd module&quot;</span>
<span class="nv">HOMEPAGE</span><span class="o">=</span><span class="s2">&quot;https://github.com/python-cmd2/cmd2&quot;</span>
@@ -833,9 +833,36 @@ python_test<span class="o">()</span> <span class="o">{</span>
</pre></div>
</div>
</section>
+<section id="running-tests-with-virtualx">
+<span id="index-16"></span><h3>Running tests with virtualx<a class="headerlink" href="#running-tests-with-virtualx" title="Permalink to this headline">¶</a></h3>
+<p>Test suites requiring a display to work correctly can often be appeased
+usng Xvfb. If the package in question does not start Xvfb directly,
+<code class="docutils literal notranslate"><span class="pre">virtualx.eclass</span></code> can be used to do that. Whenever possible, it is
+preferable to run a single server in <code class="docutils literal notranslate"><span class="pre">src_test()</span></code> for all passes
+of the test suite, e.g.:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>distutils_enable_tests pytest
+
+src_test<span class="o">()</span> <span class="o">{</span>
+ virtx distutils-r1_src_test
+<span class="o">}</span>
+</pre></div>
+</div>
+<p>Note that <code class="docutils literal notranslate"><span class="pre">virtx</span></code> implicitly enables nonfatal mode. This means that
+e.g. <code class="docutils literal notranslate"><span class="pre">epytest</span></code> will no longer terminate the ebuild on failure, and you
+need to use <code class="docutils literal notranslate"><span class="pre">die</span></code> explicitly for it:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>src_test<span class="o">()</span> <span class="o">{</span>
+ virtx distutils-r1_src_test
+<span class="o">}</span>
+
+python_test<span class="o">()</span> <span class="o">{</span>
+ epytest -m <span class="s2">&quot;not network&quot;</span> <span class="o">||</span> die <span class="s2">&quot;Tests failed with </span><span class="si">${</span><span class="nv">EPYTHON</span><span class="si">}</span><span class="s2">&quot;</span>
+<span class="o">}</span>
+</pre></div>
+</div>
+</section>
</section>
<section id="building-documentation-via-sphinx">
-<span id="index-16"></span><h2>Building documentation via Sphinx<a class="headerlink" href="#building-documentation-via-sphinx" title="Permalink to this headline">¶</a></h2>
+<span id="index-17"></span><h2>Building documentation via Sphinx<a class="headerlink" href="#building-documentation-via-sphinx" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">dev-python/sphinx</span></code> is commonly used to document Python packages.
It comes with a number of plugins and themes that make it convenient
to write and combine large text documents (such as this Guide!),