This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via b959a26ae4ab8be1f73a43b07ff9a5ffe868d067 (commit)
via bc33d8f2cb09f3d143e39856c4749874f4cc20c1 (commit)
from f47600ce8b3fcc60dc45adf89e498e51da11eac3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/b959a26ae4ab8be1f73a43b07ff9a5ffe868d067
commit b959a26ae4ab8be1f73a43b07ff9a5ffe868d067
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 7 03:46:13 2015 +0300
Fix #54: convert `assert False` to `py.test.raises`
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index bab70f7..cb50baa 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -107,11 +107,7 @@ def test_selectBy():
def test_selectBy_kwargs():
setupClass(IterTest)
- try:
- b = IterTest(nonexistant='b')
- except TypeError:
- return
- assert False, "IterTest(nonexistant='b') should raise TypeError"
+ raises(TypeError, IterTest, nonexistant='b')
class UniqTest(SQLObject):
name = StringCol(dbName='name_col', unique=True, length=100)
http://sourceforge.net/p/sqlobject/sqlobject/ci/bc33d8f2cb09f3d143e39856c4749874f4cc20c1
commit bc33d8f2cb09f3d143e39856c4749874f4cc20c1
Author: Oleg Broytman <ph...@ph...>
Date: Wed Jan 7 03:40:19 2015 +0300
Fix #53: report skipped tests
Also merge test_psycopg_sslmode.py into test_postgres.py.
diff --git a/sqlobject/inheritance/tests/test_deep_inheritance.py b/sqlobject/inheritance/tests/test_deep_inheritance.py
index 6e04e75..ec31be6 100644
--- a/sqlobject/inheritance/tests/test_deep_inheritance.py
+++ b/sqlobject/inheritance/tests/test_deep_inheritance.py
@@ -1,4 +1,4 @@
-from py.test import raises
+from py.test import raises, skip
from sqlobject import *
from sqlobject.tests.dbtest import *
from sqlobject.inheritance import InheritableSQLObject
@@ -52,7 +52,7 @@ def test_creation_fail2():
assert persons.count() == 1
if not supports('transactions'):
- return
+ skip("Transactions aren't supported")
transaction = DIPerson._connection.transaction()
kwargs ={'firstName': 'John', 'lastName': 'Doe III', 'position': 'Project Manager'}
raises(Exception, DIManager, connection=transaction, **kwargs)
diff --git a/sqlobject/tests/dbtest.py b/sqlobject/tests/dbtest.py
index 753f950..e99aed8 100644
--- a/sqlobject/tests/dbtest.py
+++ b/sqlobject/tests/dbtest.py
@@ -30,7 +30,7 @@ and you can use it like::
def test_featureX():
if not supports('featureX'):
- return
+ py.test.skip("Doesn't support featureX")
"""
supportsMatrix = {
'+exceptions': 'mysql postgres sqlite',
diff --git a/sqlobject/tests/test_SQLMultipleJoin.py b/sqlobject/tests/test_SQLMultipleJoin.py
index fbf8f6b..db7ce67 100644
--- a/sqlobject/tests/test_SQLMultipleJoin.py
+++ b/sqlobject/tests/test_SQLMultipleJoin.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -44,7 +45,7 @@ def test_1():
def test_multiple_join_transaction():
if not supports('transactions'):
- return
+ py.test.skip("Transactions aren't supported")
createAllTables()
trans = Race._connection.transaction()
try:
diff --git a/sqlobject/tests/test_SQLRelatedJoin.py b/sqlobject/tests/test_SQLRelatedJoin.py
index 96320f2..1a16ae6 100644
--- a/sqlobject/tests/test_SQLRelatedJoin.py
+++ b/sqlobject/tests/test_SQLRelatedJoin.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -45,7 +46,7 @@ def test_1():
def test_related_join_transaction():
if not supports('transactions'):
- return
+ py.test.skip("Transactions aren't supported")
createAllTables()
trans = Tourtment._connection.transaction()
try:
diff --git a/sqlobject/tests/test_basic.py b/sqlobject/tests/test_basic.py
index 869567b..6ddf03e 100644
--- a/sqlobject/tests/test_basic.py
+++ b/sqlobject/tests/test_basic.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -188,7 +189,7 @@ def test_foreignKeyDestroySelfCascade():
def testForeignKeyDropTableCascade():
if not supports('dropTableCascade'):
- return
+ py.test.skip("dropTableCascade isn't supported")
setupClass(TestSO7)
setupClass(TestSO6)
setupClass(TestSO5)
diff --git a/sqlobject/tests/test_blob.py b/sqlobject/tests/test_blob.py
index f158bd5..219ff10 100644
--- a/sqlobject/tests/test_blob.py
+++ b/sqlobject/tests/test_blob.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -10,7 +11,7 @@ class ImageData(SQLObject):
def test_BLOBCol():
if not supports('blobData'):
- return
+ py.test.skip("blobData isn't supported")
setupClass(ImageData)
data = ''.join([chr(x) for x in range(256)])
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index 1fbe9b2..02e3bff 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -25,7 +26,7 @@ class TestCyclicReferenceB(SQLObject):
def test_cyclic_reference():
if not supports('dropTableCascade'):
- return
+ py.test.skip("dropTableCascade isn't supported")
conn = getConnection()
TestCyclicReferenceA.setConnection(conn)
TestCyclicReferenceB.setConnection(conn)
diff --git a/sqlobject/tests/test_decimal.py b/sqlobject/tests/test_decimal.py
index 9e61a67..9b76cc5 100644
--- a/sqlobject/tests/test_decimal.py
+++ b/sqlobject/tests/test_decimal.py
@@ -1,5 +1,3 @@
-# -*- coding: koi8-r -*-
-
from decimal import Decimal
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -8,44 +6,47 @@ from sqlobject.tests.dbtest import *
## Decimal columns
########################################
+if not supports('decimalColumn'):
+ import py.test
+ pytestmark = py.test.mark.skipif('True')
+
class DecimalTable(SQLObject):
name = UnicodeCol(length=255)
col1 = DecimalCol(size=6, precision=4)
col2 = DecimalStringCol(size=6, precision=4)
col3 = DecimalStringCol(size=6, precision=4, quantize=True)
-if supports('decimalColumn'):
- def test_1_decimal():
- setupClass(DecimalTable)
- d = DecimalTable(name='test', col1=21.12, col2='10.01', col3='10.01')
- # psycopg2 returns float as Decimal
- if isinstance(d.col1, Decimal):
- assert d.col1 == Decimal("21.12")
- else:
- assert d.col1 == 21.12
- assert d.col2 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].to_python('10.01',
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].from_python('10.01',
- d._SO_validatorState) == "10.01"
- assert d.col3 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].to_python('10.01',
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].from_python('10.01',
- d._SO_validatorState) == "10.0100"
-
- def test_2_decimal():
- setupClass(DecimalTable)
- d = DecimalTable(name='test', col1=Decimal("21.12"),
- col2=Decimal('10.01'), col3=Decimal('10.01'))
+def test_1_decimal():
+ setupClass(DecimalTable)
+ d = DecimalTable(name='test', col1=21.12, col2='10.01', col3='10.01')
+ # psycopg2 returns float as Decimal
+ if isinstance(d.col1, Decimal):
assert d.col1 == Decimal("21.12")
- assert d.col2 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].to_python(Decimal('10.01'),
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col2'].from_python(Decimal('10.01'),
- d._SO_validatorState) == "10.01"
- assert d.col3 == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].to_python(Decimal('10.01'),
- d._SO_validatorState) == Decimal("10.01")
- assert DecimalTable.sqlmeta.columns['col3'].from_python(Decimal('10.01'),
- d._SO_validatorState) == "10.0100"
+ else:
+ assert d.col1 == 21.12
+ assert d.col2 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].to_python('10.01',
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].from_python('10.01',
+ d._SO_validatorState) == "10.01"
+ assert d.col3 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].to_python('10.01',
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].from_python('10.01',
+ d._SO_validatorState) == "10.0100"
+
+def test_2_decimal():
+ setupClass(DecimalTable)
+ d = DecimalTable(name='test', col1=Decimal("21.12"),
+ col2=Decimal('10.01'), col3=Decimal('10.01'))
+ assert d.col1 == Decimal("21.12")
+ assert d.col2 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].to_python(Decimal('10.01'),
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col2'].from_python(Decimal('10.01'),
+ d._SO_validatorState) == "10.01"
+ assert d.col3 == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].to_python(Decimal('10.01'),
+ d._SO_validatorState) == Decimal("10.01")
+ assert DecimalTable.sqlmeta.columns['col3'].from_python(Decimal('10.01'),
+ d._SO_validatorState) == "10.0100"
diff --git a/sqlobject/tests/test_empty.py b/sqlobject/tests/test_empty.py
index f7d9466..1523ea9 100644
--- a/sqlobject/tests/test_empty.py
+++ b/sqlobject/tests/test_empty.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -7,7 +8,7 @@ class EmptyClass(SQLObject):
def test_empty():
if not supports('emptyTable'):
- return
+ py.test.skip("emptyTable isn't supported")
setupClass(EmptyClass)
e1 = EmptyClass()
e2 = EmptyClass()
diff --git a/sqlobject/tests/test_exceptions.py b/sqlobject/tests/test_exceptions.py
index 0588bbc..fbc0d8a 100644
--- a/sqlobject/tests/test_exceptions.py
+++ b/sqlobject/tests/test_exceptions.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
@@ -14,7 +15,7 @@ class TestExceptionWithNonexistingTable(SQLObject):
def test_exceptions():
if not supports("exceptions"):
- return
+ py.test.skip("exceptions aren't supported")
setupClass(TestException)
TestException(name="test")
raises(DuplicateEntryError, TestException, name="test")
diff --git a/sqlobject/tests/test_indexes.py b/sqlobject/tests/test_indexes.py
index 56e0f31..ea3a7b1 100644
--- a/sqlobject/tests/test_indexes.py
+++ b/sqlobject/tests/test_indexes.py
@@ -1,5 +1,6 @@
from __future__ import print_function
+import py.test
from sqlobject import *
from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
@@ -40,7 +41,7 @@ def test_indexes_1():
def test_indexes_2():
if not supports('expressionIndex'):
- return
+ py.test.skip("expressionIndex isn't supported")
setupClass(SOIndex2)
SOIndex2(name='')
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
index 394124e..f568b2b 100644
--- a/sqlobject/tests/test_mysql.py
+++ b/sqlobject/tests/test_mysql.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -7,12 +8,12 @@ class TestSOListMySQL(SQLObject):
def test_list_databases():
connection = getConnection()
if connection.dbName != "mysql":
- return
+ py.test.skip("These tests require MySQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
connection = getConnection()
if connection.dbName != "mysql":
- return
+ py.test.skip("These tests require MySQL")
setupClass(TestSOListMySQL)
assert TestSOListMySQL.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_paste.py b/sqlobject/tests/test_paste.py
index 1aecda0..658c3f2 100644
--- a/sqlobject/tests/test_paste.py
+++ b/sqlobject/tests/test_paste.py
@@ -74,7 +74,7 @@ def test_other():
# @@: Dammit, I can't get these to pass because I can't get the
# stupid table to clear itself. setupClass() sucks. When I
# fix it I'll take this disabling out:
- return
+ py.test.skip("Oops...")
assert names() == []
assert runapp(fail=False, begin=True, abort=True, use_transaction=True)
assert names() == ['app1']
diff --git a/sqlobject/tests/test_pickle.py b/sqlobject/tests/test_pickle.py
index e782f93..1869598 100644
--- a/sqlobject/tests/test_pickle.py
+++ b/sqlobject/tests/test_pickle.py
@@ -1,4 +1,5 @@
import pickle
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -28,7 +29,7 @@ def test_pickleCol():
assert test.answer == test_answer
if (connection.dbName == 'sqlite') and connection._memory:
- return # The following test requires a different connection
+ py.test.skip("The following test requires a different connection")
test = TestPickle.get(test.id,
connection=getConnection(registry='')) # to make a different DB URI
diff --git a/sqlobject/tests/test_picklecol.py b/sqlobject/tests/test_picklecol.py
index a74914d..bcddc4f 100644
--- a/sqlobject/tests/test_picklecol.py
+++ b/sqlobject/tests/test_picklecol.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -16,7 +17,7 @@ class PickleContainer(SQLObject):
def test_pickleCol():
if not supports('blobData'):
- return
+ py.test.skip("blobData isn't supported")
setupClass([PickleContainer], force=True)
mypickledata = PickleData()
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
index 97ac280..3511348 100644
--- a/sqlobject/tests/test_postgres.py
+++ b/sqlobject/tests/test_postgres.py
@@ -1,18 +1,45 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
+########################################
+## Test PosgreSQL sslmode
+########################################
+
+class TestSSLMode(SQLObject):
+ test = StringCol()
+
+def test_sslmode():
+ setupClass(TestSSLMode)
+ connection = TestSSLMode._connection
+ if (connection.dbName != 'postgres') or \
+ (not connection.module.__name__.startswith('psycopg')):
+ py.test.skip("The test requires PostgreSQL, psycopg and ssl mode")
+
+ connection = getConnection(sslmode='require')
+ TestSSLMode._connection = connection
+ test = TestSSLMode(test='test') # Connect to the DB to test sslmode
+
+ connection.cache.clear()
+ test = TestSSLMode.select()[0]
+ assert test.test == 'test'
+
+########################################
+## Test PosgreSQL list{Database,Tables}
+########################################
+
class TestSOList(SQLObject):
pass
def test_list_databases():
connection = getConnection()
if connection.dbName != "postgres":
- return
+ py.test.skip("These tests require PostgreSQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
connection = getConnection()
if connection.dbName != "postgres":
- return
+ py.test.skip("These tests require PostgreSQL")
setupClass(TestSOList)
assert TestSOList.sqlmeta.table in connection.listTables()
diff --git a/sqlobject/tests/test_psycopg_sslmode.py b/sqlobject/tests/test_psycopg_sslmode.py
deleted file mode 100644
index a899db9..0000000
--- a/sqlobject/tests/test_psycopg_sslmode.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from sqlobject import *
-from sqlobject.tests.dbtest import *
-
-########################################
-## Test PosgreSQL sslmode
-########################################
-
-class TestSSLMode(SQLObject):
- test = StringCol()
-
-def test_sslmode():
- setupClass(TestSSLMode)
- connection = TestSSLMode._connection
- if (connection.dbName != 'postgres') or \
- (not connection.module.__name__.startswith('psycopg')):
- # sslmode is only implemented by psycopg[12] PostgreSQL driver
- return
-
- connection = getConnection(sslmode='require')
- TestSSLMode._connection = connection
- test = TestSSLMode(test='test') # Connect to the DB to test sslmode
-
- connection.cache.clear()
- test = TestSSLMode.select()[0]
- assert test.test == 'test'
diff --git a/sqlobject/tests/test_schema.py b/sqlobject/tests/test_schema.py
index 66db804..820d6cf 100644
--- a/sqlobject/tests/test_schema.py
+++ b/sqlobject/tests/test_schema.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -10,7 +11,7 @@ class TestSchema(SQLObject):
def test_connection_schema():
if not supports('schema'):
- return
+ py.test.skip("schemas aren't supported")
conn = getConnection()
conn.schema = None
conn.query('CREATE SCHEMA test')
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index 77b7f13..bab70f7 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -1,3 +1,4 @@
+import py.test
from sqlobject import *
from sqlobject.sqlbuilder import func
from sqlobject.main import SQLObjectIntegrityError
@@ -50,7 +51,7 @@ def test_03_ranged_indexed():
... 282 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|