Loading README.md 0 → 100644 +47 −0 Original line number Diff line number Diff line Unit-Test Extra =============== Unit-Test Extra provides useful utilities for unit-testing in python. Modules ------- ### generator.py The `unittest_extra.generator` module supplies a `test_generator` decorator and a `TestGeneratorMeta` meta-class to add to test suite classes which makes the `test_generator` magic work. See the documentation for `unittest_extra.generator.test_generator` for more details. ### coverage.py `unittest_extra.coverage` supplies `test_coverage_command` which is used to generate a distutils/setuptools command class wrapped around a supplied command class. On running the supplied command the wrapped command is run within a coverage context (if the `coverage` module is available). Loaded modules are temporarily unloaded to trace code run on import as well. Usage ----- The package can be installed using setuptools and used by importing ``` import unittest_extra.coverage import unittest_extra.generator ``` Alternatively; to avoid the need to have to have a third-party package installed for unit testing or to use a particular version/commit of the package the repository can be added as a git submodule and the path to the `unittest_extra` directory added to `sys.path` or the `__path__` attribute of a package (for example a `test` package for unit tests). The modules can then be imported as above for the former case or like so for the later case: ``` from test import unittest_extra ``` Loading
README.md 0 → 100644 +47 −0 Original line number Diff line number Diff line Unit-Test Extra =============== Unit-Test Extra provides useful utilities for unit-testing in python. Modules ------- ### generator.py The `unittest_extra.generator` module supplies a `test_generator` decorator and a `TestGeneratorMeta` meta-class to add to test suite classes which makes the `test_generator` magic work. See the documentation for `unittest_extra.generator.test_generator` for more details. ### coverage.py `unittest_extra.coverage` supplies `test_coverage_command` which is used to generate a distutils/setuptools command class wrapped around a supplied command class. On running the supplied command the wrapped command is run within a coverage context (if the `coverage` module is available). Loaded modules are temporarily unloaded to trace code run on import as well. Usage ----- The package can be installed using setuptools and used by importing ``` import unittest_extra.coverage import unittest_extra.generator ``` Alternatively; to avoid the need to have to have a third-party package installed for unit testing or to use a particular version/commit of the package the repository can be added as a git submodule and the path to the `unittest_extra` directory added to `sys.path` or the `__path__` attribute of a package (for example a `test` package for unit tests). The modules can then be imported as above for the former case or like so for the later case: ``` from test import unittest_extra ```