[TIP] runTest?

Marius Gedminas marius at gedmin.as
Wed Aug 28 03:24:00 PDT 2019

On Tue, Aug 27, 2019 at 05:11:53PM -0700, Chris Jerdonek wrote:
> On Tue, Aug 27, 2019 at 4:43 PM Dan Stromberg <[1]drsalists at gmail.com> wrote:
>     The closest thing that would be relevant in test_runner.py looks like:
>         test_suite.addTest(TestDisposableLocks())
> This is probably where it's happening. Here you're manually instantiating a
> TestCase object, and since no "methodName" argument is being passed to the
> constructor, it's defaulting to "runTest." (You can look at unittest's source
> code to see this.)

Right, and to make it actually pay attention to 'test*' methods in the
class, what you're supposed to do is


if you want to continue enumerating all the test classes by hand.  Or
you could use a test loader to discover all the test suite classes and
create test suites for them for you.

(Under the hood what makeSuite does is instantiate TestDisposableLocks
multiple times, passing each test name to the constructor.)

Marius Gedminas
The most straightforward thing to assume was that the BIOS was stupid (which
is, to be fair, my default assumption) and shouldn't have enabled ASPM.
        -- Matthew Garrett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20190828/4522c1c2/attachment.pgp>

More information about the testing-in-python mailing list