Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

Creating new code for reasons no one knows #1

Merged
merged 10 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ __pycache__/
# C extensions
*.so

.coverage
coverage.xml

# Distribution / packaging
.Python
build/
Expand All @@ -26,6 +29,8 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
coverage.xml
.coverage

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -120,4 +125,5 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/
local.sh
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local_token = ${LOCAL_TOKEN}
production_token = ${PRODUCTION_TOKEN}

test:
rm coverage.xml || true
rm .coverage || true
python -m pytest --cov=./

report.local:
./local.sh -t ${local_token} -F flagsecond

show_vars:
echo ${local_token}
echo ${production_token}

full.local:
${MAKE} download_local
${MAKE} test
${MAKE} report.local

download_local:
curl -s http://localhost/bash > local.sh
chmod +x ./local.sh
8 changes: 8 additions & 0 deletions awesome/code_fib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def fib(n):
if n <= 1:
return 0
return fib(n - 1) + fib(n - 2)


def untested_code(a):
raise Exception()
5 changes: 0 additions & 5 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
import awesome


def test_something():
assert awesome.smile() == 1
10 changes: 10 additions & 0 deletions tests/test_number_two.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import awesome
from awesome.code_fib import fib


def test_something():
assert awesome.smile() == ':)'


def test_a():
assert fib(2) == 0