Commits

Ralph Bean committed 8857fee

Test enhancements.

Comments (0)

Files changed (2)

 from setuptools import setup, find_packages
 
+# Required imports to avoid weird error messages in python2.7
+import multiprocessing, logging
+
 # Requirements to install buffet plugins and engines
 _extra_cheetah = ["Cheetah>=1.0", "TurboCheetah>=0.9.5"]
 _extra_genshi = ["Genshi >= 0.3.5"]

tests/test_transactions.py

+from nose.tools import eq_
 import tw2.core as twc, tw2.sqla as tws, sqlalchemy as sa, elixir as el, webtest, webob as wo, threading, os, random
 
 #import testapi
         before = len(self.DBEnt.query.all())
         self.app.get('/createok')
         el.session.remove()
-        assert(len(self.DBEnt.query.all()) == before + 1)
+        eq_(len(self.DBEnt.query.all()), before + 1)
 
     def test_createfail(self):
         el.session.remove()
         before = len(self.DBEnt.query.all())
         self.app.get('/createfail', expect_errors=True)
         el.session.remove()
-        assert(len(self.DBEnt.query.all()) == before)
+        eq_(len(self.DBEnt.query.all()), before)
 
     def test_freshness(self):
         assert(self.app.get('/read').body == 'rjb')
         thrdb.start()
         thrdb.join()
         # Check it's updated in the first thread
-        assert(self.app.get('/read').body == 'bob')
+        eq_(self.app.get('/read').body, 'bob')