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.

Files for choba, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size choba-1.0.2-py3-none-any.whl (6.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size choba-1.0.2.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page