CVS: Products/Basket/tests - testBasket.py:1.21

Chris McDonough <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Update of /cvs-repository/Products/Basket/tests
In directory cvs.zope.org:/tmp/cvs-serv19260/tests

Modified Files:
	testBasket.py 
Log Message:
Saner way of ensuring that pkg_resources exists (thanks to Fred):

 - Rename our local copy of pkg_resources (it's 0.6a7)

 - Try to import pkg_resources

 - If it doesn't exist, import our renamed version and stuff it into sys.modules.


=== Products/Basket/tests/testBasket.py 1.20 => 1.21 ===
--- Products/Basket/tests/testBasket.py:1.20	Wed Nov  9 19:00:41 2005
+++ Products/Basket/tests/testBasket.py	Wed Nov  9 19:31:12 2005
@@ -5,7 +5,7 @@
 import Products
 from Products.Basket.utils import EggProductContext
 from Products.Basket import get_containing_package
-import pkg_resources # must come after some import of something in Basket
+import pkg_resources
 from OFS.ObjectManager import ObjectManager
 from OFS.SimpleItem import SimpleItem
 from OFS.Folder import Folder
@@ -131,8 +131,7 @@
 
     def test_pkg_resources_monkeypatch(self):
         self.assertEqual(sys.modules['pkg_resources'],
-                         sys.modules['Basket.pkg_resources'],
-                         sys.modules['Products.Basket.pkg_resources'])
+                         pkg_resources)
 
     def test_require_success(self):
         basket = self._makeOne()

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.