Run skipped python tests
<p>I would like to run all unittests in a module, including the skipped ones, from the command line, without using a test runner like <code>nose</code> etc. 
Currently I have <code>python3 -m unittest discover</code>, but I don't see any option to override skipped tests. Is there a command for this?</p>

<p>Looking at the <a href="https://hg.python.org/cpython/file/3.5/Lib/unittest/main.py#l48" rel="nofollow">code</a> for the command line utility there doesn't seem to be a sane way to avoid the skipping. A nasty workaround would be to monkey-patch <code>skip</code> before discovering tests:</p>

<pre><code>python -c "import unittest as u; u.skip = lambda r: lambda t: t; u.main(None, argv=['', 'discover'])"
</code></pre>

<p>(Possibly also patch <code>unittest.case.skip</code>; this is not at all guaranteed to work as it relies on how the decorator is usually used, but you'll see whether anything still has been skipped.)</p>

python python-unittest