[Checkins] SVN: persistent/trunk/ Add 'setup.py dev' alias

Tres Seaver cvs-admin at zope.org
Mon May 14 23:22:03 UTC 2012


Log message for revision 125871:
  Add 'setup.py dev' alias
  
  - Installs 'nose' and 'coverage'.
  

Changed:
  U   persistent/trunk/CHANGES.txt
  U   persistent/trunk/persistent/tests/persistent.txt
  U   persistent/trunk/persistent/tests/test_persistent.py
  A   persistent/trunk/setup.cfg
  U   persistent/trunk/setup.py

-=-
Modified: persistent/trunk/CHANGES.txt
===================================================================
--- persistent/trunk/CHANGES.txt	2012-05-14 23:21:55 UTC (rev 125870)
+++ persistent/trunk/CHANGES.txt	2012-05-14 23:22:00 UTC (rev 125871)
@@ -4,6 +4,8 @@
 4.0 (unreleased)
 -----------------
 
+- Added ``setup.py dev`` alias (installs ``nose`` and ``coverage``).
+
 - Dropped dependency on ``zope.testing`` / ``zope.testrunner``:  tests now
   run with ``setup.py test``.
 

Modified: persistent/trunk/persistent/tests/persistent.txt
===================================================================
--- persistent/trunk/persistent/tests/persistent.txt	2012-05-14 23:21:55 UTC (rev 125870)
+++ persistent/trunk/persistent/tests/persistent.txt	2012-05-14 23:22:00 UTC (rev 125871)
@@ -5,24 +5,6 @@
 It should be replaced with normal unit tests.  (The meat of the narrative
 documentation is now in ``docs/usage`` of the distribution).
 
-The test expects a class named `P` to be
-provided in its globals.  The `P` class implements the `Persistent`
-interface.
-
-Test framework
---------------
-
-The class `P` needs to behave like `ExampleP`.  (Note that the code below
-is *not* part of the tests.)
-
-::
-
-  class ExampleP(Persistent):
-      def __init__(self):
-          self.x = 0
-      def inc(self):
-          self.x += 1
-
 The tests use stub data managers.  A data manager is responsible for
 loading and storing the state of a persistent object.  It's stored in
 the ``_p_jar`` attribute of a persistent object.
@@ -55,6 +37,13 @@
 up-to-date state.  It shouldn't change to the modified state, because it won't
 be saved when the transaction commits.
 
+  >>> from persistent import Persistent
+  >>> class P(Persistent):
+  ...     def __init__(self):
+  ...         self.x = 0
+  ...     def inc(self):
+  ...         self.x += 1
+  >>> 
   >>> p = P()
   >>> p._p_oid = 1
   >>> p._p_jar = BrokenDM()

Modified: persistent/trunk/persistent/tests/test_persistent.py
===================================================================
--- persistent/trunk/persistent/tests/test_persistent.py	2012-05-14 23:21:55 UTC (rev 125870)
+++ persistent/trunk/persistent/tests/test_persistent.py	2012-05-14 23:22:00 UTC (rev 125871)
@@ -52,6 +52,6 @@
 def test_suite():
     import doctest
     return unittest.TestSuite((
-        doctest.DocFileSuite("persistent.txt", globs={"P": P}),
+        doctest.DocFileSuite("persistent.txt"),
         doctest.DocTestSuite(),
     ))

Added: persistent/trunk/setup.cfg
===================================================================
--- persistent/trunk/setup.cfg	                        (rev 0)
+++ persistent/trunk/setup.cfg	2012-05-14 23:22:00 UTC (rev 125871)
@@ -0,0 +1,11 @@
+[nosetests]
+nocapture=1
+cover-package=persistent
+cover-erase=1
+with-doctest=0
+where=persistent
+ignore-files=wref.py
+
+[aliases]
+dev = develop easy_install persistent[testing]
+

Modified: persistent/trunk/setup.py
===================================================================
--- persistent/trunk/setup.py	2012-05-14 23:21:55 UTC (rev 125870)
+++ persistent/trunk/setup.py	2012-05-14 23:22:00 UTC (rev 125871)
@@ -80,6 +80,7 @@
       tests_require = TESTS_REQUIRE,
       extras_require = {
         'test': TESTS_REQUIRE,
+        'testing': TESTS_REQUIRE + ['nose', 'coverage'],
       },
       test_suite="persistent.tests",
       install_requires=[



More information about the checkins mailing list