taucmdr.tests package¶
Submodules¶
Module contents¶
Unit test initializations and utility functions.
-
class
taucmdr.tests.
TestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Base class for unit tests.
Performs tests in a temporary directory and reconfigures taucmdr.logger module to work with
unittest
.-
exec_command
(cmd, argv)[source]¶ Execute a tau command’s main() routine and return the exit code, stdout, and stderr data.
Parameters: Returns: (retval, stdout, stderr) results of running the command.
Return type:
-
-
class
taucmdr.tests.
TestRunner
(*args, **kwargs)[source]¶ Bases:
unittest.runner.TextTestRunner
Test suite runner.
-
taucmdr.tests.
cleanup
()[source]¶ Checks that any files or directories created during testing have been removed.
-
taucmdr.tests.
not_implemented
(cls)[source]¶ Decorator for TestCase classes to indicate that the tests have not been written (yet).
-
taucmdr.tests.
pop_test_workdir
()[source]¶ Recursively deletes the most recently created unit test working directory.
Restores the current working directory and
tempfile.tempdir
to their values beforepush_test_workdir
was called.
-
taucmdr.tests.
push_test_workdir
()[source]¶ Create a new working directory for a unit test.
Sets the current working directory and
tempfile.tempdir
to the newly created test directory.Directories created via this method are tracked. If any of them exist when the program exits then an error message is shown for each.
-
taucmdr.tests.
skipUnlessHaveCompiler
(role)[source]¶ Decorator to skip test functions when no compiler fills the given role.
If no installed compiler can fill this role then skip the test and report “<role> compiler not found”.
Parameters: role (_CompilerRole) – A compiler role.