Skip to content

Commit

Permalink
first pytest lesson in hexlet
Browse files Browse the repository at this point in the history
  • Loading branch information
user authored and user committed Nov 26, 2023
0 parents commit 126ab87
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.venv/

__pycache__/

dist/
Empty file added README.md
Empty file.
Empty file added hexlet_pytest/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions hexlet_pytest/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def reverse(string):
return string[::-1]
101 changes: 101 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "hexlet-pytest"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file added tests/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from hexlet_pytest.example import reverse

def test_reverse():
assert reverse('Hexlet') == 'telxeH'

def test_reverse_for_empty_string():
assert reverse('') == ''

0 comments on commit 126ab87

Please sign in to comment.