Python package template demonstrating TDD in Python package format for Advent of Code
- Please clone this repo or fork it to your own github account.
- Install
pytest
with your chosen python package manager.
- Put the test data as a .txt file in the
test_data
folder. - Create a
tests/test_day_{day}.py
file and write your test. - Create a
day_{day}.py
file and write your function. - Run your test by running
pytest tests
in your terminal. It is normal and ok to fail the test at first!
- Work on improving your function and run your test till your functon works.
- Once it passes the test, create your real data file in the
real_data
folder. Copy and paste your data from the aoc website. - Run your function with the full data by uncommenting the lines.
- Put your answer into the AOC website - hopefully you've got your star! ⭐
- Get your Session cookie from the advent of code website! instructions here
- Rename the .envEXAMPLE file to .env
- Replace the
cookiegoeshere
text from the .env file with your Session cookie! - Now, you should be able to pull the input data file directly from the AOC website without needing to copy and paste it into a .txt file.
Implement Continuous Integration using github actions so that your tests automatically run when you push to main!