From 7b128972360bf0b71322d5dae8f80181636bc1a2 Mon Sep 17 00:00:00 2001 From: Frank Valcarcel Date: Tue, 8 Aug 2017 15:03:41 -0600 Subject: [PATCH 1/2] pr uno --- .travis.yml | 13 +++++++++++++ mod/__init__.py | 26 ++++++++++++++++++++++++++ requirements.txt | 8 ++++++++ tests/__init__.py | 1 + tests/conftest.py | 9 +++++++++ tests/test_tests.py | 13 +++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 .travis.yml create mode 100644 mod/__init__.py create mode 100644 requirements.txt create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/test_tests.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4444de3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: python +python: +- '2.7' +sudo: false +cache: +- apt +- pip +install: +- pip install -r requirements.txt +- pip install coverage coveralls +script: py.test --cov mod --cov-report term-missing --pep8 --flakes +after_success: +- coveralls \ No newline at end of file diff --git a/mod/__init__.py b/mod/__init__.py new file mode 100644 index 0000000..8f51330 --- /dev/null +++ b/mod/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" + __init__.py + ~~~~~~~~~~~ + a little module +""" + + +def fibonacci_generator(a=0, b=1): + while True: + yield a + a, b = b, a + b + + +def fibonacci_recursive(n): + if n < 2: + return n + else: + return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2) + + +def fibonacci_bruto(): + x = [1, 1] + for i in range(10): + x.append(x[-1] + x[-2]) + print(', '.join(str(y) for y in x)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..dbae171 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +coverage==4.2 +pep8==1.7.0 +pyflakes==1.2.3 +pytest==2.9.2 +pytest-cache==1.0 +pytest-cov==2.2.1 +pytest-flakes==1.0.1 +pytest-pep8==1.0.6 \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..2a83a70 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +import pytest + + +@pytest.fixture() +def fixit(): + fixture_var = True + return fixture_var diff --git a/tests/test_tests.py b/tests/test_tests.py new file mode 100644 index 0000000..f1034f8 --- /dev/null +++ b/tests/test_tests.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + + +def test_one(fixit): + assert fixit + + +def test_addition(): + assert 1 + 1 == 2 + + +def test_fail(fixit): + assert not fixit From b0318030b0233638a6444b8d0672b843c8a78442 Mon Sep 17 00:00:00 2001 From: Frank Valcarcel Date: Tue, 8 Aug 2017 15:19:19 -0600 Subject: [PATCH 2/2] bug fixed --- tests/test_tests.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_tests.py b/tests/test_tests.py index f1034f8..0bf56ec 100644 --- a/tests/test_tests.py +++ b/tests/test_tests.py @@ -7,7 +7,3 @@ def test_one(fixit): def test_addition(): assert 1 + 1 == 2 - - -def test_fail(fixit): - assert not fixit