summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-04-08 11:36:14 +0200
committerMichał Górny <mgorny@gentoo.org>2024-04-08 11:36:14 +0200
commit565e6579bd8662001888f671ba46201586122dcb (patch)
tree8f2f80f4010cc1f36018f36fd345c6adec2d8dcf /guide/test.html
parentUpdate release feeds (diff)
downloadpython-565e6579bd8662001888f671ba46201586122dcb.tar.gz
python-565e6579bd8662001888f671ba46201586122dcb.tar.bz2
python-565e6579bd8662001888f671ba46201586122dcb.zip
Update Guide to 1d1e841
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'guide/test.html')
-rw-r--r--guide/test.html16
1 files changed, 5 insertions, 11 deletions
diff --git a/guide/test.html b/guide/test.html
index 32cf4e5..04d57e1 100644
--- a/guide/test.html
+++ b/guide/test.html
@@ -77,7 +77,6 @@ setting <code class="docutils literal notranslate"><span class="pre">RDEPEND</sp
</div>
<p>The valid values include:</p>
<ul class="simple">
-<li><p><code class="docutils literal notranslate"><span class="pre">nose</span></code> for <code class="docutils literal notranslate"><span class="pre">dev-python/nose</span></code> (<em>deprecated</em>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pytest</span></code> for <code class="docutils literal notranslate"><span class="pre">dev-python/pytest</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">setup.py</span></code> to call <code class="docutils literal notranslate"><span class="pre">setup.py</span> <span class="pre">test</span></code> (<em>deprecated</em>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">unittest</span></code> to use built-in unittest discovery</p></li>
@@ -278,22 +277,21 @@ this. In other contexts, <code class="docutils literal notranslate"><span class
<section id="choosing-the-correct-test-runner">
<h2>Choosing the correct test runner<a class="headerlink" href="#choosing-the-correct-test-runner" title="Link to this heading">¶</a></h2>
<p>There are a few modules used to run tests in Python packages. The most
-common include the built-in <a class="reference external" href="https://docs.python.org/3/library/unittest.html">unittest</a> module, <a class="reference external" href="https://docs.pytest.org/en/latest/">pytest</a> and <a class="reference external" href="https://github.com/nose-devs/nose">nose</a>. There
+common include the built-in <a class="reference external" href="https://docs.python.org/3/library/unittest.html">unittest</a> module and <a class="reference external" href="https://docs.pytest.org/en/latest/">pytest</a>. There
are also some rarely used test tools and domain-specific solutions,
e.g. <a class="reference external" href="https://www.djangoproject.com/">django</a> has its own test runner. This section will help you
determining which test runner to use and depend on.</p>
<p>Firstly, it is a good idea to look at test sources. Explicit imports
clearly indicate that a particular test runner needs to be installed,
and most likely used. For example, if at least one test file has
-<code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">pytest</span></code>, pytest is the obvious choice. If it has <code class="docutils literal notranslate"><span class="pre">import</span>
-<span class="pre">nose</span></code>, same goes for nosetests.</p>
+<code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">pytest</span></code>, pytest is the obvious choice.</p>
<p>In some rare cases the tests may use multiple test packages
simultaneously. In this case, you need to choose one of the test
runners (see other suggestions) but depend on all of them.</p>
<p>Secondly, some test suites are relying on <em>implicit</em> features of a test
-runner. For example, pytest and nose have less strict naming
-and structural requirements for test cases. In some cases, unittest
-runner will simply be unable to find all tests.</p>
+runner. For example, pytest has less strict naming and structural
+requirements for test cases. In some cases, unittest runner will simply
+be unable to find all tests.</p>
<p>Thirdly, there are cases when a particular feature of a test runner
is desired even if it is not strictly necessary to run tests. This
is particularly the case with pytest’s output capture that can make
@@ -307,10 +305,6 @@ built-in unittest module), using it is preferable to avoid unnecessary
dependencies. However, you need to make sure that it finds all tests
correctly (i.e. runs no less tests than the alternative) and that it
does not spew too much irrelevant output.</p>
-<p>If both pytest and nose seem equally good, the former is recommended
-as the latter has ceased development and requires downstream patching.
-If you have some free time, convincing upstream to switch from nose
-to pytest is a worthwhile goal.</p>
</section>
<section id="undesirable-test-dependencies">
<h2>Undesirable test dependencies<a class="headerlink" href="#undesirable-test-dependencies" title="Link to this heading">¶</a></h2>