Browse Source

Updating pytest example

pull/6/head
Ryan Reed 3 years ago
parent
commit
b6f706bb74
1 changed files with 16 additions and 8 deletions
  1. +16
    -8
      README.md

+ 16
- 8
README.md View File

@ -21,18 +21,26 @@ pip install -r requirements.text
Each day will include a pytest script that uses examples from the day.
This allows for verifying the code works by running `pytest`. For example:
Note: `--durations=0` shows the slowest tests (if taking longer then 0.005s
```
|--% pytest -v puzzles/test_day01.py
=========================================== test session starts ===========================================
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- .venv/bin/python3
|--% pytest -v --durations=0 puzzles/test_day04.py
============================================= test session starts ==============================================
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- venv-2021-advent-of-code/bin/python3
cachedir: .pytest_cache
rootdir: 2021-advent-of-code
collected 4 items
puzzles/test_day01.py::test_example1 PASSED [ 25%]
puzzles/test_day01.py::test_example2 PASSED [ 50%]
puzzles/test_day01.py::test_part1 PASSED [ 75%]
puzzles/test_day01.py::test_part2 PASSED [100%]
puzzles/test_day04.py::test_example1 PASSED [ 25%]
puzzles/test_day04.py::test_example2 PASSED [ 50%]
puzzles/test_day04.py::test_part1 PASSED [ 75%]
puzzles/test_day04.py::test_part2 PASSED [100%]
============================================== slowest durations ===============================================
0.10s call puzzles/test_day04.py::test_part2
0.06s call puzzles/test_day04.py::test_part1
============================================ 4 passed in 0.06s ============================================
(10 durations < 0.005s hidden. Use -vv to show these durations.)
============================================== 4 passed in 0.23s ===============================================
```

Loading…
Cancel
Save