Skip to main content

Python unittest simplified.

Project description


Wrapper to simplify calls to python unittest, coverage and webtest.


$ pip install choba
$ choba -h
Usage: choba [-hl] [-s <submodule>] [-f <filter>] <dir>


$ export PYTHONPATH=`pwd`/src
$ choba <your_test_directory>

The call will internally process ./.coveragerc. HTML and Cobertura-compatible XML code coverage report are automatically generated.

sample configuration .coveragerc:
source = src
omit =

directory = docs/coverage

output = docs/coverage/coverage.xml

exclude_lines = if __name__ ==

In choba, branch coverage is always true regardless what you put in the configuration file.

sample module:
# ./src/myproject/common/

import re

def flatten(text):
    Remove line breaks and trim.
    text = re.sub(r'[\r\n\t]+', ' ', text)
    text = re.sub(r'  +', ' ', text)
    return text.strip()
sample test:
# ./tests/common/

import unittest

# test against ./src/myproject/common/
from myproject import utils

class TestCommon(unittest.TestCase):

    def test_myfunc(self):
        text = "\raaa\nbbb\t\r\n"
        self.assertEquals("aaa bbb", utils.flatten(text))

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

choba-1.0.2.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

choba-1.0.2-py3-none-any.whl (6.1 kB view hashes)

Uploaded py3

Supported by

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