Practicing TDD with Python.
Fizz Buzz prints "Fizz" for numbers that are multiples of 3, "Buzz" for multiples of 5 and "FizzBuzz" for multioples of 3 and 5.
- Python 3.7.0
- PyTest 4.4.0
- Make sure your IDE uses spaces instead of tabs or you get error, "IndentationError: unindent does not match any outer indentation level'
- Check Python version,
python -V
- Clone repo
- Install pytest,
pip install pytest
- Check pytest version,
pytest --version
- Run test,
pytest FizzBuzzTest.py
- Red, Green, Refactor
- Write the simplest test possible then write just enough code to get it to pass
- Pytest verbose mode,
pytest -v
- Set git username,
git config --global user.name "Mona Lisa"
- Check git username,
git config --global user.name
- Python uses four spaces to indent code and does not use tabs
- Test functions should start with the word "test"
- Classes should start with "Test". Note the capitol "T"
- Filesnames of test modules should start or end with test, "test_example.py"