From 96a72b7d31bdc1588e5d5753f14b4a38c6eb1afc Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 21:40:34 +0100 Subject: [PATCH 01/14] Add codecov badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 01482b44..33899de8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![codecov.io](https://codecov.io/github/sbellem/example-python/coverage.svg?branch=master)](https://codecov.io/github/sbellem/example-python?branch=master) + + Python Example ======= | [https://codecov.io/][1] | [@codecov][2] | [hello@codecov.io][3] | From 1434c58358284016eafd0c0abcb32f22ae97678d Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 21:46:05 +0100 Subject: [PATCH 02/14] Add travis badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 33899de8..9e717c18 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://travis-ci.org/sbellem/example-python.svg)](https://travis-ci.org/sbellem/example-python) [![codecov.io](https://codecov.io/github/sbellem/example-python/coverage.svg?branch=master)](https://codecov.io/github/sbellem/example-python?branch=master) From 5bca6aa2cb11b3bcecd3305b72ca27cffed15e0f Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:01:29 +0100 Subject: [PATCH 03/14] Use pytest --- .travis.yml | 4 ++-- requirements.txt | 1 + requirements/travis.txt | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 requirements.txt create mode 100644 requirements/travis.txt diff --git a/.travis.yml b/.travis.yml index 0ee96174..38471f19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ python: - 2.7 install: - - pip install codecov + - pip install requirements/travis.txt script: - - coverage run tests.py + - py.test -v --cov=awesome tests.py after_success: - codecov diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..15f1c729 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +codecov diff --git a/requirements/travis.txt b/requirements/travis.txt new file mode 100644 index 00000000..c391699a --- /dev/null +++ b/requirements/travis.txt @@ -0,0 +1,3 @@ +codecov==1.6.2 +pytest==2.8.2 +pytest-cov==2.2.0 From 93f35f067c3c6d14179de93ef76fb9549cce7fdf Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:04:11 +0100 Subject: [PATCH 04/14] Recurse --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 38471f19..c94daf1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - 2.7 install: - - pip install requirements/travis.txt + - pip install -r requirements/travis.txt script: - py.test -v --cov=awesome tests.py From 0253ff1ce99d49a7b211dc975171b9fa82a1e48b Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:09:07 +0100 Subject: [PATCH 05/14] Remove requirements.txt --- requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 15f1c729..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -codecov From 51cd283724c201b97213172b5aae100a75c9704f Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:17:02 +0100 Subject: [PATCH 06/14] Use pytest styled tests --- tests.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests.py b/tests.py index 92aa2034..7589a700 100644 --- a/tests.py +++ b/tests.py @@ -1,12 +1,8 @@ -import unittest +def test_smile(): + from awesome import smile + assert smile() == ':)' -import awesome - -class TestMethods(unittest.TestCase): - def test_add(self): - self.assertEqual(awesome.smile(), ":)") - - -if __name__ == '__main__': - unittest.main() +def test_frown(): + from awesome import frown + assert frown() == ':(' From 6d1c0797b1931b422050d89e291166a9fe459bb0 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:29:03 +0100 Subject: [PATCH 07/14] Add new function --- awesome/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/awesome/__init__.py b/awesome/__init__.py index 4d34acc6..a145e1b6 100644 --- a/awesome/__init__.py +++ b/awesome/__init__.py @@ -1,5 +1,10 @@ def smile(): - return ":)" + return ':)' + def frown(): - return ":(" + return ':(' + + +def laugh(): + return ':-D' From 788dc67e1bde72fc2930e6bbcc985bd9cf682055 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:29:17 +0100 Subject: [PATCH 08/14] Add coverage config --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..4672b3b1 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[report] +fail_under = 90 From 28d4c0f99716ed4a48545b0290c28830ba59a5f7 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:38:14 +0100 Subject: [PATCH 09/14] Lower threshold for coverage --- .coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 4672b3b1..74841575 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,2 @@ [report] -fail_under = 90 +fail_under = 80 From 73e4928b5e3d732c6429774d43e2dbc2453cf526 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:44:01 +0100 Subject: [PATCH 10/14] Add graph badge (?) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9e717c18..26ee5c43 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Build Status](https://travis-ci.org/sbellem/example-python.svg)](https://travis-ci.org/sbellem/example-python) [![codecov.io](https://codecov.io/github/sbellem/example-python/coverage.svg?branch=master)](https://codecov.io/github/sbellem/example-python?branch=master) +![codecov.io](https://codecov.io/github/sbellem/example-python/branch.svg?branch=master) Python Example From b0112c523f8eaf3f163a38021f8cfc980561ea20 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:55:55 +0100 Subject: [PATCH 11/14] Add function for cry emoticon --- awesome/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awesome/__init__.py b/awesome/__init__.py index a145e1b6..7531841d 100644 --- a/awesome/__init__.py +++ b/awesome/__init__.py @@ -8,3 +8,7 @@ def frown(): def laugh(): return ':-D' + + +def cry(): + return '(:_;)' From 4b53ece3e738c9ea78f1df80a6fc98d7fa390788 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 22:58:04 +0100 Subject: [PATCH 12/14] Lower required coverage --- .coveragerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 74841575..fa464ee0 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,2 @@ [report] -fail_under = 80 +fail_under = 70 From 605f07b0db50579ad1d15edf4f774bfafa186a1a Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 23:01:14 +0100 Subject: [PATCH 13/14] Add test for laugh function --- tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests.py b/tests.py index 7589a700..464c5b28 100644 --- a/tests.py +++ b/tests.py @@ -6,3 +6,8 @@ def test_smile(): def test_frown(): from awesome import frown assert frown() == ':(' + + +def test_laugh(): + from awesome import laugh + assert laugh() == ':-D' From 03871435500cdaa80980fa962e5e9161b70e7267 Mon Sep 17 00:00:00 2001 From: Sylvain Bellemare Date: Mon, 9 Nov 2015 23:03:59 +0100 Subject: [PATCH 14/14] Add test for cry function --- tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests.py b/tests.py index 464c5b28..59b58c9e 100644 --- a/tests.py +++ b/tests.py @@ -11,3 +11,8 @@ def test_frown(): def test_laugh(): from awesome import laugh assert laugh() == ':-D' + + +def test_cry(): + from awesome import cry + assert cry() == '(:_;)' pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy