Skip to content

Commit

Permalink
Small fixes to increase coverage correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
derphilipp committed Dec 11, 2014
1 parent a60b17c commit 4d737fe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ omit =
*/site-packages/nose/*
*/test/*
exclude_lines =
pragma: no cover
assert False
raise NotImplementedError
if __name__ == .__main__.:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vaguery.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def test_unicode(self):


class Test_vag_departure_with_errors():
@pytest.fixture(autouse=True)
def add_response(self):
url_re = re.compile(r'http://start.vag.de/dm/api/abfahrten.json/.*')
body = """{
Expand All @@ -141,7 +142,6 @@ def add_response(self):
content_type=content_type)

@responses.activate
@pytest.fixture(autouse=True)
def test_station_without_any_transportation(self):
self.add_response()
pytest.raises(
Expand Down
2 changes: 1 addition & 1 deletion vagquery/departure.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def departure_in_min_planned(self):

def __str__(self):
if sys.version_info.major >= 3:
return self.__unicode__()
return self.__unicode__() # pragma: no cover
else:
return unicode(self).encode('utf-8') # NOQA

Expand Down
6 changes: 3 additions & 3 deletions vagquery/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import requests
import sys

if sys.version_info.major >= 3:
if sys.version_info.major >= 3: # pragma: no cover
from urllib.parse import urlencode
else: # pragma: no cover
else: # pragam: no cover
from urllib import urlencode


Expand Down Expand Up @@ -34,7 +34,7 @@ def __init__(self, station_id, name, vag_name):
self.vag_name = vag_name

def __str__(self):
if sys.version_info.major >= 3:
if sys.version_info.major >= 3: # pragma: no cover
return self.__unicode__()
else:
return unicode(self).encode('utf-8') # NOQA
Expand Down

0 comments on commit 4d737fe

Please sign in to comment.