Skip to content

jimr/testy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testy

image

All the assertions from Testify but cleaned up a bit & with added py3k support.

Should work with Python 2.5-3.3 and pypy 1.9. To make sure it will work for you: python setup.py test.

Installation

There are no dependencies. Simply: pip install testy

Example Usage

import re
import unittest

from testy.assertions import assert_dict_subset, assert_raises, assert_match_regex

class MyTestCase(unittest.TestCase):
    def setUp(self):
        self.x = dict(a=1, b=2)

    def test_x(self):
        assert_dict_subset(dict(b=2), self.x)

    def test_exception(self):
        with assert_raises(TypeError):
            raise TypeError("Call some code you expect to fail here.")

    def test_pattern(self):
        pattern = re.compile('\w')
        assert_match_regex(pattern, 'abc')

    def tearDown(self):
        self.x = None

if __name__ == "__main__":
    unittest.main()

About

Python unittest helpers adapted from Testify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages