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..0bf56ec --- /dev/null +++ b/tests/test_tests.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + + +def test_one(fixit): + assert fixit + + +def test_addition(): + assert 1 + 1 == 2