-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b0d256
commit 4c969a0
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pylint | ||
pytest | ||
black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|