makePythonTdd.shΒΆ
- Here is the - ./makePythonTdd.shprogram from how to make a python test driven development environment- #!/bin/bash PROJECT_NAME=$1 mkdir $PROJECT_NAME cd $PROJECT_NAME mkdir src touch src/$PROJECT_NAME.py mkdir tests touch tests/__init__.py echo "import unittest class Test$PROJECT_NAME(unittest.TestCase): def test_failure(self): self.assertFalse(True) # Exceptions Encountered # AssertionError " > tests/test_$PROJECT_NAME.py python3 -m venv .venv source .venv/bin/activate python3 -m pip install --upgrade pip echo pytest-watch > requirements.txt python3 -m pip install --requirement requirements.txt pytest-watch 
- use - chmodto make the program executable- chmod +x makePythonTdd.sh 
- give a name for the - $PROJECT_NAMEvariable when the program is called to make a Test Driven Development any time you want. For example typing this command in the terminal in the folder where- makePythonTdd.shis saved will make a Test Driven Development environment for a project called calculator- ./makePythonTdd.sh calculator