Skip to content

Commit

Permalink
Merge fdaa4f5 into 7790572
Browse files Browse the repository at this point in the history
  • Loading branch information
lipemorais committed Sep 20, 2017
2 parents 7790572 + fdaa4f5 commit 5f1849c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ cache:
jobs:
include:
- stage: unit
script: coverage run -m unittest discover tests/unit
script: pytest tests/unit

- stage: journey
script: travis_wait 40 coverage run -m unittest discover tests/journey
script: travis_wait 40 pytest tests/journey

- stage: deploy
script: skip
Expand All @@ -24,6 +24,6 @@ jobs:

install:
- python setup.py develop
- pip install coveralls
- pip install coveralls pytest pytest-cov

after_success: coveralls
9 changes: 3 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,13 @@ Within your `virtualenv <https://virtualenv.pypa.io/en/stable/>`_:
Always add tests to your contribution — if you want to test it locally before opening the PR:

::

$ python -m unittest discover tests
$ pip install pytest pytest-cov
$ pytest

When the tests are passing, also check for coverage of the modules you edited or added — if you want to check it before opening the PR:

::

$ pip install coverage
$ coverage run -m unittest discover tests
$ coverage html
$ pytest
$ open htmlcov/index.html

Follow `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_ and best practices implemented by `Landscape <https://landscape.io>`_ in the `veryhigh` strictness level — if you want to check them locally before opening the PR:
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --verbose --durations=10 --cov-report html
5 changes: 2 additions & 3 deletions tests/journey/test_chamber_of_deputies_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from datetime import date
from tempfile import mkdtemp
from shutil import rmtree
from unittest import main, TestCase
from unittest import main, TestCase, skip

from serenata_toolbox.chamber_of_deputies.dataset import Dataset

Expand All @@ -20,10 +20,9 @@ def setUp(self):
def tearDown(self):
rmtree(self.path, ignore_errors=True)


def test_fetch_translate_clean_integration(self):
self.subject.fetch()
files = ["Ano-{}.csv".format(n) for n in self.years]
files = ["Ano-{}.csv".format(n) for n in [2017]]
files.append('datasets-format.html')

for name in files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_fetch(self):
'canceled', 'report_status', 'report_details_link'
]
self.assertTrue(np.array_equal(expectedColumns, actualColumns))
self.assertEqual(56, len(df))
self.assertEqual(57, len(df))

expectedCanceled = ['No', 'Yes']
actualCanceled = df.canceled.unique()
Expand Down

0 comments on commit 5f1849c

Please sign in to comment.