[TIP] Does testscenarios employ unittest?

Ben Finney ben+python at benfinney.id.au
Sun Sep 25 19:49:45 PDT 2016


boB Stepp <robertvstepp at gmail.com> writes:

> I finally figured out how to use testscenarios for the simple problem
> I am using to start learning TDD.  I was surprised to discover that I
> did not need to import unittest.

You do need your test case classes to inherit from ‘unittest.TestCase’.

What you may be doing is inheriting your test case classes from some
other class which *itself* is a subclass of ‘unittest.TestCase’.

> I was under the (perhaps mistaken?) impression that testscenarios was
> an extension of the unittest module.

Not an extension of; but its functionality is intended to work with
‘unittest.TestCase’ instances.

> Does testscenarios use unittest behind the scenes?

Yes.

-- 
 \       “… whoever claims any right that he is unwilling to accord to |
  `\             his fellow-men is dishonest and infamous.” —Robert G. |
_o__)           Ingersoll, _The Liberty of Man, Woman and Child_, 1877 |
Ben Finney




More information about the testing-in-python mailing list