Testify travis-ci python

A more pythonic testing framework.

6 years after

Testify - A Testing Framework

Testify is a replacement for Python's unittest module and nose. It is modeled after unittest, and existing unittest classes are fully supported.

However, Testify has features above and beyond unittest:

  • Class-level setup and teardown fixture methods, which are run only once for an entire class of test methods.

  • A decorator-based approach to fixture methods, enabling features like lazily-evaluated attributes and context managers for tests.

  • Enhanced test discovery. Testify can drill down into packages to find test cases (similiar to nose).

  • Support for detecting and running test suites, grouped by modules, classes, or individual test methods.

  • Support for splitting up tests into buckets for multiprocessing.

  • Pretty test runner output (hooray color!).

  • Extensible plugin system for adding additional functionality around reporting.

  • Comes complete with other handy testing utilities, including turtle (for mocking), code coverage integration, profiling, and numerous common assertion helpers for easier debugging.

  • More pythonic naming conventions.

Example Test Case

from testify import *

class AdditionTestCase(TestCase):

    @class_setup
    def init_the_variable(self):
        self.variable = 0

    @setup
    def increment_the_variable(self):
        self.variable += 1

    def test_the_variable(self):
        assert_equal(self.variable, 1)

    @suite('disabled', reason='ticket #123, not equal to 2 places')
    def test_broken(self):
        # raises 'AssertionError: 1 !~= 1.01'
        assert_almost_equal(1, 1.01, threshold=2)

    @teardown
    def decrement_the_variable(self):
        self.variable -= 1

    @class_teardown
    def get_rid_of_the_variable(self):
        self.variable = None

if __name__ == "__main__":
    run()

Related Repositories

gocompatible

gocompatible

Find packages dependent on yours and run their tests to ensure you maintain back ...

assert

assert

testify/assert but as testify/require ...

vim-testify

vim-testify

Simplified viml testing ...

test_kicker

test_kicker

A lightweight autotester based on Kicker and Testify ...

amen

amen

experimental successor to testify ...


Top Contributors

EvanKrall ayust rhettg blampe mrtyler Roguelazer sumeet eklitzke att14 msabramo bigo slingamn bukzor dnephin eskil jmsdncn jof rubik shoenig

Releases

-   0.3.0 zip tar
-   0.3.0p1 zip tar
-   0.2.10 zip tar
-   0.2.9 zip tar
-   0.2.8 zip tar
-   0.2.7 zip tar
-   0.2.6 zip tar
-   0.2.5 zip tar
-   0.2.4 zip tar
-   0.2.3 zip tar
-   0.2.2 zip tar
-   0.2.1 zip tar
-   0.2.0c zip tar
-   0.2.0b zip tar
-   0.2.0a zip tar
-   0.1.12 zip tar
-   0.1.11 zip tar
-   0.1.10 zip tar
-   0.1.9 zip tar
-   0.1.8 zip tar
-   0.1.7 zip tar
-   0.1.6 zip tar
-   0.1.5 zip tar
-   0.1.4 zip tar
-   0.1.3 zip tar
-   0.1.2 zip tar
-   0.1.1 zip tar