A Light Python unittest Setup
TODO: Run these samples to verify they work as expected
This is what I'm using when I don't want to make a full module for python. It keeps all the files in the same directory which isn't wonderful from a tidyness perspective, but it's fine. The other option is to setup a [TODO: Code shorthand span ] directory, but that requires jumping through some more hoops.
NOTE: Another way I'm doing this is to name the test files [TODO: Code shorthand span ] then switching the run call to `x*.py`. This makes tab completition a little easier.
### ./run_tests.bash
#!/bin/bash
python -m unittest discover -s . -p '*_test.py'
### ./test_01_basic_example.py
NOTE: This file cannot start with a number
#!/usr/bin/env python
# ^ this wasn't in the orignal sample, but I think it needs to be here
global
=
= True
=
### ./charlie_snake.py
#!/usr/bin/env python
return True
~ fin ~