diff options
-rw-r--r-- | .gitignore | 13 | ||||
-rw-r--r-- | setup.py | 59 | ||||
-rw-r--r-- | src/zope/i18n/tests/test_formats.py | 6 | ||||
-rw-r--r-- | src/zope/i18n/tests/test_itranslationdomain.py | 2 | ||||
-rw-r--r-- | src/zope/i18n/tests/test_zcml.py | 14 | ||||
-rw-r--r-- | tox.ini | 18 |
6 files changed, 81 insertions, 31 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8312c60 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.pyc +*.so +*.dll +*.mo +__pycache__ +src/*.egg-info + +.installed.cfg +.tox +bin +build +develop-eggs +parts @@ -25,6 +25,21 @@ def read(*rnames): text = open(os.path.join(os.path.dirname(__file__), *rnames)).read() return text +def alltests(): + import os + import sys + import unittest + # use the zope.testrunner machinery to find all the + # test suites we've put under ourselves + import zope.testrunner.find + import zope.testrunner.options + here = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')) + args = sys.argv[:] + defaults = ["--test-path", here] + options = zope.testrunner.options.get_options(args, defaults) + suites = list(zope.testrunner.find.find_suites(options)) + return unittest.TestSuite(suites) + setup( name='zope.i18n', version='4.0.0a5.dev0', @@ -45,11 +60,13 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', @@ -58,16 +75,20 @@ setup( packages=find_packages('src'), package_dir={'': 'src'}, namespace_packages=['zope',], - install_requires=['setuptools', - 'pytz', - 'zope.schema', - 'zope.i18nmessageid', - 'zope.component', - ], - include_package_data=True, - zip_safe=False, + install_requires=[ + 'setuptools', + 'pytz', + 'zope.schema', + 'zope.i18nmessageid', + 'zope.component', + ], extras_require=dict( - test=['zope.testing'], + test=[ + 'zope.component [zcml]', + 'zope.configuration', + 'zope.security', + 'zope.testing' + ], compile=['python-gettext'], zcml=[ 'zope.component [zcml]', @@ -75,4 +96,14 @@ setup( 'zope.security', ], ), + tests_require = [ + 'zope.component [zcml]', + 'zope.configuration', + 'zope.security', + 'zope.testing', + 'zope.testrunner', + ], + test_suite = '__main__.alltests', + include_package_data=True, + zip_safe=False, ) diff --git a/src/zope/i18n/tests/test_formats.py b/src/zope/i18n/tests/test_formats.py index 0c260b4..ca3aeb2 100644 --- a/src/zope/i18n/tests/test_formats.py +++ b/src/zope/i18n/tests/test_formats.py @@ -178,7 +178,7 @@ class TestDateTimePatternParser(TestCase): try: parseDateTimePattern("HHHHH") except DateTimePatternParseError as err: - self.assert_(str(err).endswith('You have: 5')) + self.assertTrue(str(err).endswith('You have: 5')) class TestBuildDateTimeParseInfo(TestCase): @@ -255,7 +255,7 @@ class TestDateTimeFormat(TestCase): format = DateTimeFormat(calendar=LocaleCalendarStub()) def testInterfaceConformity(self): - self.assert_(IDateTimeFormat.providedBy(self.format)) + self.assertTrue(IDateTimeFormat.providedBy(self.format)) def testParseSimpleDateTime(self): # German short @@ -828,7 +828,7 @@ class TestNumberFormat(TestCase): 'infinity': 'oo', 'nan': 'N/A'}) def testInterfaceConformity(self): - self.assert_(INumberFormat.providedBy(self.format)) + self.assertTrue(INumberFormat.providedBy(self.format)) def testParseSimpleInteger(self): self.assertEqual(self.format.parse('23341', '###0'), diff --git a/src/zope/i18n/tests/test_itranslationdomain.py b/src/zope/i18n/tests/test_itranslationdomain.py index 9e1775c..53fda3e 100644 --- a/src/zope/i18n/tests/test_itranslationdomain.py +++ b/src/zope/i18n/tests/test_itranslationdomain.py @@ -93,7 +93,7 @@ class TestITranslationDomain(PlacelessSetup): translate = self._domain.translate translated = translate('no way', target_language='en') self.assertEqual(translated, "no way") - self.assert_(type(translated) is unicode) + self.assertTrue(type(translated) is unicode) def testNoTargetLanguage(self): translate = self._domain.translate diff --git a/src/zope/i18n/tests/test_zcml.py b/src/zope/i18n/tests/test_zcml.py index fc9d90c..968c47e 100644 --- a/src/zope/i18n/tests/test_zcml.py +++ b/src/zope/i18n/tests/test_zcml.py @@ -57,7 +57,7 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): def testRegisterTranslations(self): from zope.configuration import xmlconfig - self.assert_(queryUtility(ITranslationDomain) is None) + self.assertTrue(queryUtility(ITranslationDomain) is None) xmlconfig.string( template % ''' <configure package="zope.i18n.tests"> @@ -72,7 +72,7 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): def testAllowedTranslations(self): from zope.configuration import xmlconfig - self.assert_(queryUtility(ITranslationDomain) is None) + self.assertTrue(queryUtility(ITranslationDomain) is None) config.ALLOWED_LANGUAGES = ('de', 'fr') xmlconfig.string( template % ''' @@ -88,7 +88,7 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): def testRegisterDistributedTranslations(self): from zope.configuration import xmlconfig - self.assert_(queryUtility(ITranslationDomain, 'zope-i18n') is None) + self.assertTrue(queryUtility(ITranslationDomain, 'zope-i18n') is None) xmlconfig.string( template % ''' <configure package="zope.i18n.tests"> @@ -122,7 +122,7 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): def testRegisterAndCompileTranslations(self): from zope.configuration import xmlconfig config.COMPILE_MO_FILES = True - self.assert_(queryUtility(ITranslationDomain) is None) + self.assertTrue(queryUtility(ITranslationDomain) is None) # Copy an old and outdated file over, so we can test if the # newer file check works @@ -160,8 +160,8 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): def testRegisterTranslationsForDomain(self): from zope.configuration import xmlconfig - self.assert_(queryUtility(ITranslationDomain, 'zope-i18n') is None) - self.assert_(queryUtility(ITranslationDomain, 'zope-i18n2') is None) + self.assertTrue(queryUtility(ITranslationDomain, 'zope-i18n') is None) + self.assertTrue(queryUtility(ITranslationDomain, 'zope-i18n2') is None) xmlconfig.string( template % ''' <configure package="zope.i18n.tests"> @@ -174,7 +174,7 @@ class DirectivesTest(PlacelessSetup, unittest.TestCase): self.assertEquals(util._catalogs, {'test': ['test'], 'en': [unicode(path)]}) - self.assert_(queryUtility(ITranslationDomain, 'zope-i18n2') is None) + self.assertTrue(queryUtility(ITranslationDomain, 'zope-i18n2') is None) def test_suite(): @@ -1,12 +1,18 @@ -# content of: tox.ini , put in same dir as setup.py [tox] -envlist = py26,py27,py33 +envlist = py26,py27,py33,pypy [testenv] -deps=zope.testrunner - zope.testing +commands = + python setup.py test -q +deps = python-gettext + pytz + zope.component zope.configuration + zope.i18nmessageid + zope.location + zope.proxy + zope.schema zope.security - -commands=zope-testrunner --all --test-path=src -v + zope.testing + zope.testrunner |