Skip to content

jerry-git/test-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-skeleton

Build Status Pypi Py vers

A tool for creating a skeleton for Python unit tests based on source code.

Basically, this is a tool for non-TDD development. Use TDD if possible.

A potential use case for this tool could e.g. a legacy project which lacks tests.

Usage

python -m test_skeleton path/to/your/source_file.py

The result will be printed to std out. If you want to store it into a file, use --save flag. The result will be stored into test_<original_filename> in your current working directory.

Example

Input:

class Klass(object):
    klass_var = ''

    def __init__(self):
        self.a = ''

    @property
    def property1(self):
        pass

    @classmethod
    def klassmethod1(cls):
        pass

    def method_with_under_scores(self):
        pass


def helper_function1():
    pass

Output:

class TestKlass:
    class TestProperty1:
        def test_TODO(self):
            pass

    class TestKlassmethod1:
        def test_TODO(self):
            pass

    class TestMethodWithUnderScores:
        def test_TODO(self):
            pass


class TestHelperFunction1:
    def test_TODO(self):
        pass

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages