Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #249 from mozilla-services/enable-coveralls
Browse files Browse the repository at this point in the history
Enable coveralls
  • Loading branch information
Natim committed Apr 14, 2015
2 parents 8a167eb + 3074890 commit a5bb089
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ install:
script:
- if [[ $ACTION != loadtest ]]; then tox -e $TOX_ENV; fi
- if [[ $ACTION == loadtest ]]; then make loadtest-check; fi
after_success:
# Report coverage results to coveralls.io
- pip install coveralls
- coveralls
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serve: install-dev
$(VENV)/bin/pserve $(SERVER_CONFIG) --reload

tests-once: install-dev
$(VENV)/bin/nosetests -s --with-mocha-reporter --with-coverage --cover-package=readinglist
$(VENV)/bin/nosetests -s --with-mocha-reporter --cover-min-percentage=100 --with-coverage --cover-package=readinglist

tests:
tox
Expand Down
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Reading List
============

|travis| |readthedocs|
|travis| |master-coverage| |readthedocs|

.. |travis| image:: https://travis-ci.org/mozilla-services/readinglist.svg?branch=master
:target: https://travis-ci.org/mozilla-services/readinglist
Expand All @@ -10,6 +10,11 @@ Reading List
:target: http://readinglist.readthedocs.org/en/latest/
:alt: Documentation Status

.. |master-coverage| image::
https://coveralls.io/repos/mozilla-services/readinglist/badge.png?branch=master
:alt: Coverage
:target: https://coveralls.io/r/mozilla-services/readinglist

*Reading List* is a service that aims to synchronize a list of articles URLs
between a set of devices owned by a same account.

Expand Down
26 changes: 26 additions & 0 deletions readinglist/tests/test_initialization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys

import mock

import readinglist
from .support import unittest


class GEventActivationTest(unittest.TestCase):
def setUp(self):
self.gevent_mocked = mock.MagicMock()
self.psycogreen_mocked = mock.MagicMock()
sys.modules['gevent'] = self.gevent_mocked
sys.modules['gevent.monkey'] = self.gevent_mocked.monkey
sys.modules['psycogreen'] = self.psycogreen_mocked
sys.modules['psycogreen.gevent'] = self.psycogreen_mocked.gevent

def test_gevent_is_not_setup_by_default(self):
readinglist.patch_gevent({})
self.assertFalse(self.gevent_mocked.monkey.patch_socket.called)
self.assertFalse(self.psycogreen_mocked.gevent.patch_psycopg.called)

def test_gevent_is_activated_from_settings(self):
readinglist.patch_gevent({'readinglist.gevent_enabled': 'true'})
self.assertTrue(self.gevent_mocked.monkey.patch_socket.called)
self.assertTrue(self.psycogreen_mocked.gevent.patch_psycopg.called)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ envlist = py27,py34,flake8
[testenv]
commands =
python --version
nosetests --with-coverage --cover-package=readinglist readinglist {posargs}
nosetests --with-coverage --cover-min-percentage=100 --cover-package=readinglist readinglist {posargs}
deps =
coverage
nose
Expand Down

0 comments on commit a5bb089

Please sign in to comment.