[Checkins] SVN: zope.dottedname/trunk/ Made tests pass on Python 3.2, 3.3 and PyPy.

Marius Gedminas cvs-admin at zope.org
Fri Feb 1 21:07:15 UTC 2013


Log message for revision 129119:
  Made tests pass on Python 3.2, 3.3 and PyPy.
  
  No code changes were required, just some renormalizers to unify exception
  and some builtin object representations.
  
  Add tox.ini and MANIFEST.in.
  
  I can't figure out tox -e coverage: looks like it doesn't even notice the
  zope.dottedname.resolve module?  Maybe I need some magic incantations in a
  setup.cfg or something?  I need to grab Tres and have him teach me.
  
  

Changed:
  _U  zope.dottedname/trunk/
  U   zope.dottedname/trunk/CHANGES.txt
  A   zope.dottedname/trunk/MANIFEST.in
  U   zope.dottedname/trunk/setup.py
  U   zope.dottedname/trunk/src/zope/dottedname/tests.py
  A   zope.dottedname/trunk/tox.ini

-=-

Property changes on: zope.dottedname/trunk
___________________________________________________________________
Modified: svn:ignore
   - bin
build
dist
lib
develop-eggs
eggs
parts
.installed.cfg

   + bin
build
dist
lib
develop-eggs
eggs
parts
.installed.cfg
.tox


Modified: zope.dottedname/trunk/CHANGES.txt
===================================================================
--- zope.dottedname/trunk/CHANGES.txt	2013-01-31 12:47:06 UTC (rev 129118)
+++ zope.dottedname/trunk/CHANGES.txt	2013-02-01 21:07:15 UTC (rev 129119)
@@ -1,11 +1,12 @@
 CHANGES
 =======
 
-3.4.7 (unreleased)
+4.0.0 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Made tests pass on Python 3.2, 3.3 and PyPy.
 
+- Added support for continuous integration using ``tox``.
 
 3.4.6 (2009-09-15)
 ------------------

Added: zope.dottedname/trunk/MANIFEST.in
===================================================================
--- zope.dottedname/trunk/MANIFEST.in	                        (rev 0)
+++ zope.dottedname/trunk/MANIFEST.in	2013-02-01 21:07:15 UTC (rev 129119)
@@ -0,0 +1,4 @@
+include *.py
+include *.txt
+include buildout.cfg
+recursive-include src *.txt

Modified: zope.dottedname/trunk/setup.py
===================================================================
--- zope.dottedname/trunk/setup.py	2013-01-31 12:47:06 UTC (rev 129118)
+++ zope.dottedname/trunk/setup.py	2013-02-01 21:07:15 UTC (rev 129119)
@@ -38,6 +38,10 @@
           'Intended Audience :: Developers',
           'License :: OSI Approved :: Zope Public License',
           'Programming Language :: Python',
+          'Programming Language :: Python :: 2.6',
+          'Programming Language :: Python :: 2.7',
+          'Programming Language :: Python :: 3.2',
+          'Programming Language :: Python :: 3.3',
           'Natural Language :: English',
           'Operating System :: OS Independent',
           'Topic :: Internet :: WWW/HTTP',
@@ -48,6 +52,10 @@
       package_dir = {'': 'src'},
       namespace_packages=['zope'],
       install_requires = ['setuptools'],
+      extras_require = {
+          'testing': ['zope.testing'],
+      },
+      tests_require = ['zope.testing'],
       test_suite='zope.dottedname.tests.test_suite',
       include_package_data=True,
       zip_safe = False

Modified: zope.dottedname/trunk/src/zope/dottedname/tests.py
===================================================================
--- zope.dottedname/trunk/src/zope/dottedname/tests.py	2013-01-31 12:47:06 UTC (rev 129118)
+++ zope.dottedname/trunk/src/zope/dottedname/tests.py	2013-02-01 21:07:15 UTC (rev 129119)
@@ -16,11 +16,34 @@
 import unittest
 import doctest
 import os
+import re
 
+from zope.testing.renormalizing import RENormalizing
+
 README = os.path.abspath(os.path.join(os.path.dirname(__file__), 'README.txt'))
 FLAGS = doctest.REPORT_NDIFF | doctest.ELLIPSIS
 
 def test_suite():
+    checker = RENormalizing([
+        # datetime is a class in Python 3, but a type in Python 2
+        (re.compile("<class 'datetime\.datetime'>"),
+         "<type 'datetime.datetime'>"),
+        # Python 3.2 adds quotes around the module name
+        (re.compile("ImportError: No module named '([^']*)'"),
+         r"ImportError: No module named \1"),
+        # and improves the message in other ways too
+        (re.compile(r"ImportError: No module named datetime\.foo;"
+                    " datetime is not a package"),
+         "ImportError: No module named foo"),
+        # PyPy 1.9 has some different error messages and reprs
+        (re.compile(r"ImportError: No module named datetime\.foo"),
+         "ImportError: No module named foo"),
+        (re.compile(r"<bound method type\.now of <type 'datetime\.datetime'>>"),
+         "<built-in method now of type object at ...>"),
+    ])
     return unittest.TestSuite((
-        doctest.DocFileSuite(README, optionflags=FLAGS, module_relative=False),
+        doctest.DocFileSuite(README,
+                             checker=checker,
+                             optionflags=FLAGS,
+                             module_relative=False),
     ))

Added: zope.dottedname/trunk/tox.ini
===================================================================
--- zope.dottedname/trunk/tox.ini	                        (rev 0)
+++ zope.dottedname/trunk/tox.ini	2013-02-01 21:07:15 UTC (rev 129119)
@@ -0,0 +1,24 @@
+[tox]
+envlist =
+    py26,py27,py32,py33,pypy
+
+[testenv]
+commands =
+    python setup.py test -q
+
+[testenv:coverage]
+basepython =
+    python2.6
+commands = 
+#   The installed version messes up nose's test discovery / coverage reporting
+#   So, we uninstall that from the environment, and then install the editable
+#   version, before running nosetests.
+    pip uninstall -y zope.dottedname
+    pip install -e .
+    nosetests --with-xunit --with-xcoverage
+deps =
+    nose
+    coverage
+    nosexcover
+    zope.testing
+



More information about the checkins mailing list