Skip to main content

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

Project description

# test-skeleton

[![Build Status](https://travis-ci.org/jerry-git/test-skeleton.svg?branch=master)](https://travis-ci.org/jerry-git/test-skeleton)
[![Pypi](https://img.shields.io/pypi/v/test-skeleton.svg)](https://pypi.python.org/pypi/test-skeleton)
[![Py vers](https://img.shields.io/pypi/pyversions/test-skeleton.svg)](https://pypi.python.org/pypi/test-skeleton)

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
```bash
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:
```python
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:
```python
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

```

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

test-skeleton-0.1.2.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file test-skeleton-0.1.2.tar.gz.

File metadata

File hashes

Hashes for test-skeleton-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f255cbe10f843d60b5de52b1e6edb5f25a0bdc4588ab3c6b84ff73bfccc5736a
MD5 c3b2de8d9d56a891a2248330c6390a0a
BLAKE2b-256 ac327ad8f706bf451116b63f340aab73e912f66d3f7bb46cc6527b3b48567245

See more details on using hashes here.

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