Skip to main content

Python unittest helpers adapted from Testify

Project description

All the assertions from Testify but with py3k support.

The only requirement is six (for combined Python 2.x & 3.x support):

pip install -r requirements.txt

Should work OK with Python 2.5-3.3.

Installation

Install direct from the cheese shop:

pip install testy

Example Usage

import re
import unittest

from testy.assertions import assert_equal, assert_raises, assert_match_regex

class MyTestCase(unittest.TestCase):
    def setUp(self):
        self.x = 1

    def test_x(self):
        assert_equal(self.x, 1)

    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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testy-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file testy-0.1.1.tar.gz.

File metadata

  • Download URL: testy-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for testy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7edc0014e734f051b6c94eb72e286d4e7a24211924a088db16708ae3255e9e16
MD5 a15eb621fab35949c3525198f2edb922
BLAKE2b-256 1b33fae2c90b289e744baaf0ce08ec25fa9061caf638fa6df81505da6be84413

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page