https://github.com/jerry-git/test-skeleton
https://github.com/jerry-git/test-skeleton
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jerry-git/test-skeleton
- Owner: jerry-git
- License: mit
- Created: 2017-12-15T10:01:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-25T17:15:36.000Z (over 7 years ago)
- Last Synced: 2025-03-11T13:41:46.038Z (3 months ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test-skeleton
[](https://travis-ci.org/jerry-git/test-skeleton)
[](https://pypi.python.org/pypi/test-skeleton)
[](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_ 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):
passdef method_with_under_scores(self):
passdef helper_function1():
pass```
Output:
```python
class TestKlass:
class TestProperty1:
def test_TODO(self):
passclass TestKlassmethod1:
def test_TODO(self):
passclass TestMethodWithUnderScores:
def test_TODO(self):
passclass TestHelperFunction1:
def test_TODO(self):
pass```