Skip to content

Commit d255e45

Browse files
authored
chore: merge pull request #33 from threeal/test-with-pytest
Implementation of pytest for Testing
2 parents 816cef8 + 63b4283 commit d255e45

File tree

5 files changed

+73
-1
lines changed

5 files changed

+73
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@ jobs:
4444
- name: Check lint
4545
run: poetry run flake8 lib
4646

47+
- name: Run testing
48+
run: poetry run pytest -v
49+
4750
- name: Run module
4851
run: poetry run my_fibonacci 10

poetry.lock

Lines changed: 63 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ optional = true
3535
black = "^23.10.0"
3636
isort = "^5.12.0"
3737
flake8 = "^6.1.0"
38+
pytest = "^7.4.2"
3839

3940
[tool.poetry.scripts]
4041
my_fibonacci = "my_fibonacci:main"

tests/__init__.py

Whitespace-only changes.

tests/test_sequence.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from my_fibonacci import fibonacci_sequence
2+
3+
def test_fibonacci_sequence():
4+
assert fibonacci_sequence(1) == [1]
5+
assert fibonacci_sequence(2) == [1, 1]
6+
assert fibonacci_sequence(5) == [1, 1, 2, 3, 5]

0 commit comments

Comments
 (0)