Referencing the 'candidate' variable from within the test case is not a good approach as it's referencing a module global instead of an attribute. Additionally, it only exists when the module is executed directly, so if it's imported and run in a different manner a name error will result for every test that references.
As for the TestProgram, it's inheriting routines from the base class in the unittest module that do introspection to find all test fixtures.
As for the TestProgram, it's inheriting routines from the base class in the unittest module that do introspection to find all test fixtures.