Skip to content

CarbonLighthouse/click-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

click-tester

Provides utilities for testing command line tools built with Pocoo Click library.

Install

Available on pypi

pip install click-tester

ClickRunnerTestCase

A unittest.TestCase subclass which provides convenience methods for testing click commands. Handles and displays errors, traceback information and command output.

import click
from click_tester import ClickRunnerTestCase


@click.command()
@click.option('--noun')
def hello(noun):
    print('hello ' + noun + '!')


class TestHelloCmd(ClickRunnerTestCase):
    def test_message(self):
        self.expect_invoke_success(my_command,
                                   ['--noun=world'],
                                   r'^hello world!')

About

Provides utilities for testing command line tools built with Pocoo Click library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published