Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert committed Apr 8, 2014
1 parent 0066eb9 commit b031827
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
'mock',
]


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests']
self.test_suite = True

def run_tests(self):
#import here, cause outside the eggs aren't loaded
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
Expand Down Expand Up @@ -58,7 +59,7 @@ def run_tests(self):
zip_safe=True,
install_requires=install_requires,
tests_require=tests_require,
cmdclass = {'test': PyTest},
cmdclass={'test': PyTest},
entry_points='''
[console_scripts]
polint = lingua.polint:main
Expand Down
3 changes: 1 addition & 2 deletions src/lingua/extract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import print_function
import argparse
import collections
import datetime
import os
import sys
import time
Expand Down Expand Up @@ -72,7 +71,7 @@ def metadata_as_entry(self):
year = time.localtime().tm_year
header = [u'SOME DESCRIPTIVE TITLE']
if self.copyright_holder:
header.append(u'Copyright (C) %d %s' % (year, self.copyright_holder))
header.append(u'Copyright (C) %d %s' % (year, self.copyright_holder))
header.append(
u'This file is distributed under the same license as the %s package.' %
self.package_name)
Expand Down
15 changes: 2 additions & 13 deletions tests/extractors/test_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_translate_explicit_msgid():
assert messages[0].msgid == u'msgid_dummy'
assert messages[0].comment == u'Default: Dummy téxt'


@pytest.mark.usefixtures('fake_source')
def test_translate_subelement():
global source
Expand All @@ -164,6 +165,7 @@ def test_translate_subelement():
assert messages[0].msgid == u'msgid_dummy'
assert messages[0].comment == u'Default: Dummy <dynamic element> demø'


@pytest.mark.usefixtures('fake_source')
def test_translate_named_subelement():
global source
Expand Down Expand Up @@ -323,16 +325,3 @@ def test_multiple_expressions_with_translate_calls():
messages = list(extract_xml('filename', _options()))
assert messages[0].msgid == u'foo'
assert messages[1].msgid == u'bar'


@pytest.mark.usefixtures('fake_source')
def test_translate_call_in_python_expression_in_attribute():
global source
source = b'''\
<html xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="lingua">
<dummy title="${_(u'foo')}"></dummy>
</html>
'''
messages = list(extract_xml('filename', _options()))
assert messages[0].msgid == u'foo'

0 comments on commit b031827

Please sign in to comment.