https://github.com/paparascal2020/simple-tdd-template-python
A simple skeleton TDD envorment for Python3
https://github.com/paparascal2020/simple-tdd-template-python
Last synced: about 1 month ago
JSON representation
A simple skeleton TDD envorment for Python3
- Host: GitHub
- URL: https://github.com/paparascal2020/simple-tdd-template-python
- Owner: PapaRascal2020
- Created: 2022-06-25T14:46:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-25T15:05:17.000Z (almost 4 years ago)
- Last Synced: 2025-01-02T18:20:20.481Z (over 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple enviroment for Python3 TDD
A simple skeleton project to test Python code using pytest
## First Steps
* Download/Clone the repository
I have included a simple math test just to show its working.
This is what I use for my Python3 TDD.
## Create your own tests.
For the test portion:
* Create a new folder within tests directory like 'test_{0}'
* Create an empty __init__.py script in the folder
* Create 'test_{0}.py'
Replace {0} with your class name
For the class portion:
* CD into src directory
* Create an empty __init__.py script in the folder
* Create '{0}.py'
Replace {0} with your test name
Reference the class using an import in your test_{0}.py script
-- I have included an example to help.
## Run tests
* Open root folder in the terminal/command prompt
* RUN python -m pytest tests
## Requirements
* Python3
* pytest (Can be installed by opening terminal/command prompt and typing "pip install pytest")