14
0
forked from pool/python-pony
Files
python-pony/fix-tests.patch

39 lines
1.4 KiB
Diff
Raw Normal View History

Index: pony-0.7.6/pony/orm/tests/test_show.py
===================================================================
--- pony-0.7.6.orig/pony/orm/tests/test_show.py
+++ pony-0.7.6/pony/orm/tests/test_show.py
@@ -53,7 +53,10 @@ class TestShow(unittest.TestCase):
def test_1(self):
Student.select().show()
- self.assertEqual('\n'+sys.stdout.getvalue().replace(' ', '~'), '''
+ txt = sys.stdout.getvalue().replace(' ', '~')
+ txt = txt[txt.index('id|'):]
+
+ self.assertEqual('\n'+txt, '''
id|name|scholarship|gpa|dob~~~~~~~|group~~~
--+----+-----------+---+----------+--------
1~|S1~~|None~~~~~~~|3.1|None~~~~~~|Group[1]
@@ -63,7 +66,9 @@ id|name|scholarship|gpa|dob~~~~~~~|group
def test_2(self):
Group.select().show()
- self.assertEqual('\n'+sys.stdout.getvalue().replace(' ', '~'), '''
+ txt = sys.stdout.getvalue().replace(' ', '~')
+ txt = txt[txt.index('number\n'):]
+ self.assertEqual('\n'+txt, '''
number
------
1~~~~~
Index: pony-0.7.6/pony/orm/tests/__init__.py
===================================================================
--- pony-0.7.6.orig/pony/orm/tests/__init__.py
+++ pony-0.7.6/pony/orm/tests/__init__.py
@@ -1,4 +1,4 @@
import pony.orm.core, pony.options
pony.options.CUT_TRACEBACK = False
-pony.orm.core.sql_debug(False)
\ No newline at end of file
+pony.orm.core.sql_debug(True)