Skip to content

Commit

Permalink
adding scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
TheStoneMX committed Jun 3, 2024
1 parent 7b0d256 commit 4c969a0
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
install:
pip install --upgrade pip &&\
pip install -r requirements.txt

test:
python -m pytest -vv test_hello.py

format:
black *.py


lint:
pylint --disable=R,C hello.py

all: install lint test
15 changes: 15 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#var=1
#var=var

def toyou(x):
return f"hi {x}"


def add(x):
return x + 1


def subtract(x):
return x - 1


3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pylint
pytest
black
21 changes: 21 additions & 0 deletions test_hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from hello import toyou, add, subtract


def setup_function(function):
print(f" Running Setup: {function.__name__}")
function.x = 10


def teardown_function(function):
print(f" Running Teardown: {function.__name__}")
del function.x


### Run to see failed test
#def test_hello_add():
# assert add(test_hello_add.x) == 12

def test_hello_subtract():
assert subtract(test_hello_subtract.x) == 9


0 comments on commit 4c969a0

Please sign in to comment.