mirror of
https://github.com/Noettore/AdventOfCode.git
synced 2025-10-14 19:26:39 +02:00
AoC 2020: day6, benchmark
Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
2
.github/workflows/python.yml
vendored
2
.github/workflows/python.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install flake8 pytest
|
||||
python -m pip install flake8 pytest pytest-benchmark
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@ __pycache__
|
||||
|
||||
# Pytest
|
||||
.pytest_cache
|
||||
.benchmarks
|
||||
|
||||
#VSCode
|
||||
.vscode
|
||||
|
@@ -49,12 +49,16 @@ def part2(entries: list) -> int:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
def test():
|
||||
def test_input():
|
||||
"""pytest testing function"""
|
||||
entries = extract(TEST_INPUT)
|
||||
assert part1(entries) == 11
|
||||
assert part2(entries) == 6
|
||||
|
||||
def test_bench(benchmark):
|
||||
"""pytest-benchmark function"""
|
||||
benchmark(main)
|
||||
|
||||
def main():
|
||||
"""main function"""
|
||||
input_path = str(pathlib.Path(__file__).resolve().parent.parent) + "/inputs/" + str(pathlib.Path(__file__).stem)
|
||||
|
Reference in New Issue
Block a user