Skip to content
Open
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
23 changes: 20 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,27 @@ python:
- "2.7"
# - "pypy"

cache: "pip"

# Enable newer 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
allow_failures:
- python: "3.4"
- python: "3.5"
include:
- python: 3.7
dist: xenial
sudo: true

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
before_install:
- sudo apt-get install -y gcc-4.7 g++-4.7 libicu-dev
install:
- sudo apt-get install gcc-4.7 g++-4.7 python-numpy libicu-dev
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
- pip install polyglot

# command to run tests, e.g. python setup.py test
script: nosetests
script: py.test -rfs --cov=polyglot --cov-report term-missing --cov-report xml
after_success:
- ls
- coveralls
5 changes: 5 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.txt
pytest
coverage>=4.4
pytest-cov
coveralls
4 changes: 3 additions & 1 deletion docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
polyglot
========

|Downloads| |Latest Version| |Build Status| |Documentation Status|
|Downloads| |Latest Version| |Build Status| |Documentation Status| |Code Coverage Status|

.. |Downloads| image:: https://img.shields.io/pypi/dm/polyglot.svg
:target: https://pypi.python.org/pypi/polyglot
Expand All @@ -12,6 +12,8 @@ polyglot
:target: https://travis-ci.org/aboSamoor/polyglot
.. |Documentation Status| image:: https://readthedocs.org/projects/polyglot/badge/?version=latest
:target: https://readthedocs.org/builds/polyglot/
.. |Code Coverage Status| image:: https://coveralls.io/repos/github/aboSamoor/polyglot/badge.svg?branch=master
:target: https://coveralls.io/github/aboSamoor/polyglot?branch=master

Polyglot is a natural language pipeline that supports massive
multilingual applications.
Expand Down
32 changes: 32 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
test_basic
----------------------------------

basic tests for `polyglot` module.
"""

import pytest
import polyglot


@pytest.mark.xfail()
@pytest.mark.parametrize(
"text_input,expected_code,expected_name",
[
("Bonjour, Mesdames.", "fr", "French"),
("Preprocessing is an essential step.", "en", "English"),
],
)
def test_language_detection(text_input, expected_code, expected_name):
from polyglot.text import Text

poly_text = polyglot.Text(text_input)
assert poly_text.language.code == expected_code
assert poly_text.language.name == expected_lang


if __name__ == "__main__":
pytest.main(["-vv"])
28 changes: 0 additions & 28 deletions tests/test_polyglot.py

This file was deleted.

20 changes: 20 additions & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
test_smoke
----------------------------------

smoke tests for `polyglot` module.
"""

import pytest


def test_for_fire():
"""Make sure nothing blows up while importing polyglot"""
import polyglot


if __name__ == "__main__":
pytest.main(["-v"])