Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit tests to allow for coverage report #32

Merged
merged 3 commits into from
Jan 25, 2020
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
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ before_install:

install:
- python setup.py install
- pip install "pytest==4.6.9" # pytest 4.6.X works best for older Python versions
# TODO: last LXML version compatible with Python 3.4 is 4.3.4
# pinned dependency for backwards compatibility
- pip install 'coverage==4.5.4' pytest-cov
- pip install "pytest==4.6.9" # pytest 4.6.X works best for older Python versions
- pip install -U codecov 'coverage==4.5.4' pytest-cov

script:
- py.test --cov
- py.test tests/

after_success:
- codecov
Empty file added tests/__init__.py
Empty file.
4 changes: 1 addition & 3 deletions tests/test_classify_paragraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

import unittest

from justext.core import PathInfo, classify_paragraphs
from justext.paragraph import Paragraph


class TestClassifyParagraphs(unittest.TestCase):
class TestClassifyParagraphs():

def _paragraph(self, **kwargs):
path = PathInfo().append("body").append("p")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

import unittest

from justext.core import PathInfo

import unittest


class TestPathInfo(unittest.TestCase):
def test_empty_path(self):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_sax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

import unittest

from lxml import html
from justext.core import ParagraphMaker


class TestSax(unittest.TestCase):
class TestSax():

def assert_paragraphs_equal(self, paragraph, **kwargs):
for name, value in kwargs.items():
Expand Down
5 changes: 2 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

import unittest
import pytest

from justext.utils import is_blank, normalize_whitespace, get_stoplists, get_stoplist


class TestStringUtils(unittest.TestCase):
class TestStringUtils():

def test_empty_string_is_blank(self):
assert is_blank("")
Expand Down Expand Up @@ -58,7 +57,7 @@ def test_normalize_non_break_spaces(self):
assert expected == normalize_whitespace(string)


class TestStoplistsUtils(unittest.TestCase):
class TestStoplistsUtils():

def test_get_stopwords_list(self):
stopwords = get_stoplists()
Expand Down