Skip to content

Commit f78b3f8

Browse files
committed
adding skeleton
1 parent 642c6fd commit f78b3f8

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
install:
2+
pip install --upgrade pip &&\
3+
pip install -r requirements.txt
4+
5+
test:
6+
python -m pytest -vv test_hello.py
7+
8+
9+
lint:
10+
pylint --disable=R,C hello.py
11+
12+
all: install lint test

hello.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def toyou(x):
2+
return f"hi {x}"
3+
4+
5+
def add(x):
6+
return x + 1
7+
8+
9+
def subtract(x):
10+
return x - 1

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pylint
2+
pytest
3+
black

test_hello.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from hello import toyou, add, subtract
2+
3+
4+
def setup_function(function):
5+
print(f" Running Setup: {function.__name__}")
6+
function.x = 10
7+
8+
9+
def teardown_function(function):
10+
print(f" Running Teardown: {function.__name__}")
11+
del function.x
12+
13+
14+
### Run to see failed test
15+
#def test_hello_add():
16+
# assert add(test_hello_add.x) == 12
17+
18+
def test_hello_subtract():
19+
assert subtract(test_hello_subtract.x) == 9

0 commit comments

Comments
 (0)