[SQL-CVS] SQLObject development repository branch master updated. 3.1.0-137-gac4a243
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <no...@so...> - 2017-01-14 18:16:34
|
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 discards a349d7391a6a868758553cf6a3efa9d72e532dec (commit) discards 42354eecb64659544f8efa80b04da466eac76989 (commit) via ac4a243bc2e029e29991b99a33d5fb5cb386b901 (commit) via 94fbfc6ccfba12e66b280ce9718dc4d480e16278 (commit) via f5a10076a404097d8dae92a7a1694ed63b0887c7 (commit) via 05471b88131b94a6c8fdd75d48c95e8a9ab538aa (commit) via da5a72be1c6295c5f643dfe9241851549370900f (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (a349d7391a6a868758553cf6a3efa9d72e532dec) \ N -- N -- N (ac4a243bc2e029e29991b99a33d5fb5cb386b901) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. 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/ac4a243bc2e029e29991b99a33d5fb5cb386b901 commit ac4a243bc2e029e29991b99a33d5fb5cb386b901 Author: Oleg Broytman <ph...@ph...> Date: Sat Jan 14 20:37:46 2017 +0300 pyfirebirdsql driver is tested but has problems diff --git a/docs/News.rst b/docs/News.rst index a043ed6..0d60aee 100644 --- a/docs/News.rst +++ b/docs/News.rst @@ -22,7 +22,7 @@ Minor features * Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb' or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that - order. pyfirebirdsql is supported but untested. + order. pyfirebirdsql is supported but has problems. * Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb', 'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only. http://sourceforge.net/p/sqlobject/sqlobject/ci/94fbfc6ccfba12e66b280ce9718dc4d480e16278 commit 94fbfc6ccfba12e66b280ce9718dc4d480e16278 Author: Oleg Broytman <ph...@ph...> Date: Sat Jan 14 20:23:37 2017 +0300 Fix string.find - it returns -1 on error diff --git a/sqlobject/tests/test_converters.py b/sqlobject/tests/test_converters.py index f43da5e..0468a75 100644 --- a/sqlobject/tests/test_converters.py +++ b/sqlobject/tests/test_converters.py @@ -111,19 +111,19 @@ def test_bool(): def test_datetime(): from datetime import datetime, date, time - if SODateTimeCol.datetimeFormat.find('.%f'): + if SODateTimeCol.datetimeFormat.find('.%f') > 0: assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == \ "'2005-07-14 13:31:02.000000'" else: assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == \ "'2005-07-14 13:31:02'" assert sqlrepr(date(2005, 7, 14)) == "'2005-07-14'" - if SOTimeCol.timeFormat.find('.%f'): + if SOTimeCol.timeFormat.find('.%f') > 0: assert sqlrepr(time(13, 31, 2)) == "'13:31:02.000000'" else: assert sqlrepr(time(13, 31, 2)) == "'13:31:02'" # now dates before 1900 - if SODateTimeCol.datetimeFormat.find('.%f'): + if SODateTimeCol.datetimeFormat.find('.%f') > 0: assert sqlrepr(datetime(1428, 7, 14, 13, 31, 2)) == \ "'1428-07-14 13:31:02.000000'" else: http://sourceforge.net/p/sqlobject/sqlobject/ci/f5a10076a404097d8dae92a7a1694ed63b0887c7 commit f5a10076a404097d8dae92a7a1694ed63b0887c7 Author: Oleg Broytman <ph...@ph...> Date: Sat Jan 14 20:02:47 2017 +0300 Run SQLite tests with in-memory DB diff --git a/.travis.yml b/.travis.yml index a1d309b..0f83b96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,10 @@ env: - TOXENV=py27-sqlite - TOXENV=py34-sqlite - TOXENV=py35-sqlite + - TOXENV=py26-sqlite-memory + - TOXENV=py27-sqlite-memory + - TOXENV=py34-sqlite-memory + - TOXENV=py35-sqlite-memory - TOXENV=py27-flake8 - TOXENV=py34-flake8 - TOXENV=py27-firebird-fdb diff --git a/appveyor.yml b/appveyor.yml index 2cba27b..a92631c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,6 +55,10 @@ environment: TOX_ENV: "pywin27-sqlite" - PYTHON: "C:\\Python34" TOX_ENV: "pywin34-sqlite" + - PYTHON: "C:\\Python27" + TOX_ENV: "pywin27-sqlite-memory" + - PYTHON: "C:\\Python34" + TOX_ENV: "pywin34-sqlite-memory" install: # Ensure we use the right python version diff --git a/tox.ini b/tox.ini index 8ef632a..7f86236 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.8 -envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{mssql,postgres-psycopg,sqlite} +envlist = py{26,27}-{mysqldb,mysql-oursql},py{34,35}-{mysqlclient,pypostgresql},py{26,27,34,35}-{mysql-connector,pymysql,postgres-psycopg,postgres-pygresql,postgres-pg8000,sqlite,sqlite-memory},py{27,34,35}-{firebird-fdb,firebirdsql},py{27,34}-flake8,pywin{27,34}-{mssql,postgres-psycopg,sqlite,sqlite-memory} # Base test environment settings [testenv] @@ -205,6 +205,22 @@ commands = {[sqlite]commands} [testenv:py35-sqlite] commands = {[sqlite]commands} +[sqlite-memory] +commands = + pytest --cov=sqlobject -D sqlite:/:memory:?debug=1 + +[testenv:py26-sqlite-memory] +commands = {[sqlite-memory]commands} + +[testenv:py27-sqlite-memory] +commands = {[sqlite-memory]commands} + +[testenv:py34-sqlite-memory] +commands = {[sqlite-memory]commands} + +[testenv:py35-sqlite-memory] +commands = {[sqlite-memory]commands} + # Firebird database test environments [fdb] commands = @@ -288,3 +304,13 @@ commands = {[sqlite-w32]commands} [testenv:pywin34-sqlite] commands = {[sqlite-w32]commands} + +[sqlite-memory-w32] +commands = + pytest --cov=sqlobject -D sqlite:/:memory:?debug=1 + +[testenv:pywin27-sqlite-memory] +commands = {[sqlite-memory-w32]commands} + +[testenv:pywin34-sqlite-memory] +commands = {[sqlite-memory-w32]commands} http://sourceforge.net/p/sqlobject/sqlobject/ci/05471b88131b94a6c8fdd75d48c95e8a9ab538aa commit 05471b88131b94a6c8fdd75d48c95e8a9ab538aa Author: Oleg Broytman <ph...@ph...> Date: Sat Jan 14 18:22:19 2017 +0300 Refactor skipping DB-specific test Skip the entire modules instead of skipping tests one by one. diff --git a/sqlobject/tests/test_decimal.py b/sqlobject/tests/test_decimal.py index 82c67e9..c7388e0 100644 --- a/sqlobject/tests/test_decimal.py +++ b/sqlobject/tests/test_decimal.py @@ -13,9 +13,10 @@ try: support_decimal_column = supports('decimalColumn') except NameError: # The module was imported during documentation building - support_decimal_column = True -if not support_decimal_column: - pytestmark = pytest.mark.skip('') + pass +else: + if not support_decimal_column: + pytestmark = pytest.mark.skip('') class DecimalTable(SQLObject): diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py index 59c21ca..d712ed0 100644 --- a/sqlobject/tests/test_mysql.py +++ b/sqlobject/tests/test_mysql.py @@ -3,20 +3,24 @@ from sqlobject import SQLObject from sqlobject.tests.dbtest import getConnection, setupClass +try: + connection = getConnection() +except NameError: + # The module was imported during documentation building + pass +else: + if connection.dbName != "mysql": + pytestmark = pytest.mark.skip('') + + class SOTestSOListMySQL(SQLObject): pass def test_list_databases(): - connection = getConnection() - if connection.dbName != "mysql": - pytest.skip("These tests require MySQL") assert connection.db in connection.listDatabases() def test_list_tables(): - connection = getConnection() - if connection.dbName != "mysql": - pytest.skip("These tests require MySQL") setupClass(SOTestSOListMySQL) assert SOTestSOListMySQL.sqlmeta.table in connection.listTables() diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py index b2b8895..ab01717 100644 --- a/sqlobject/tests/test_postgres.py +++ b/sqlobject/tests/test_postgres.py @@ -9,6 +9,16 @@ from sqlobject.tests.dbtest import getConnection, setupClass ######################################## +try: + connection = getConnection() +except NameError: + # The module was imported during documentation building + pass +else: + if connection.dbName != "postgres": + pytestmark = pytest.mark.skip('') + + class SOTestSSLMode(SQLObject): test = StringCol() @@ -16,8 +26,7 @@ class SOTestSSLMode(SQLObject): def test_sslmode(): setupClass(SOTestSSLMode) connection = SOTestSSLMode._connection - if (connection.dbName != 'postgres') or \ - (not connection.module.__name__.startswith('psycopg')) or \ + if (not connection.module.__name__.startswith('psycopg')) or \ (os.name == 'nt'): pytest.skip("The test requires PostgreSQL, psycopg and ssl mode; " "also it doesn't work on w32") @@ -41,15 +50,9 @@ class SOTestSOList(SQLObject): def test_list_databases(): - connection = getConnection() - if connection.dbName != "postgres": - pytest.skip("These tests require PostgreSQL") assert connection.db in connection.listDatabases() def test_list_tables(): - connection = getConnection() - if connection.dbName != "postgres": - pytest.skip("These tests require PostgreSQL") setupClass(SOTestSOList) assert SOTestSOList.sqlmeta.table in connection.listTables() diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py index 7b3f11d..b782eea 100644 --- a/sqlobject/tests/test_sqlite.py +++ b/sqlobject/tests/test_sqlite.py @@ -7,6 +7,16 @@ from sqlobject.tests.dbtest import setSQLiteConnectionFactory from .test_basic import SOTestSO1 +try: + connection = getConnection() +except NameError: + # The module was imported during documentation building + pass +else: + if connection.dbName != "sqlite": + pytestmark = pytest.mark.skip('') + + class SQLiteFactoryTest(SQLObject): name = StringCol() @@ -14,8 +24,6 @@ class SQLiteFactoryTest(SQLObject): def test_sqlite_factory(): setupClass(SQLiteFactoryTest) - if SQLiteFactoryTest._connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") if not SQLiteFactoryTest._connection.using_sqlite2: pytest.skip("These tests require SQLite v2+") @@ -37,8 +45,6 @@ def test_sqlite_factory(): def test_sqlite_factory_str(): setupClass(SQLiteFactoryTest) - if SQLiteFactoryTest._connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") if not SQLiteFactoryTest._connection.using_sqlite2: pytest.skip("These tests require SQLite v2+") @@ -64,8 +70,6 @@ def test_sqlite_factory_str(): def test_sqlite_aggregate(): setupClass(SQLiteFactoryTest) - if SQLiteFactoryTest._connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") if not SQLiteFactoryTest._connection.using_sqlite2: pytest.skip("These tests require SQLite v2+") @@ -125,9 +129,6 @@ def test_empty_string(): def test_memorydb(): if not supports("memorydb"): pytest.skip("memorydb isn't supported") - connection = getConnection() - if connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") if not connection._memory: pytest.skip("The connection isn't memorydb") setupClass(SOTestSO1) @@ -137,15 +138,9 @@ def test_memorydb(): def test_list_databases(): - connection = getConnection() - if connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") assert connection.listDatabases() == ['main'] def test_list_tables(): - connection = getConnection() - if connection.dbName != "sqlite": - pytest.skip("These tests require SQLite") setupClass(SOTestSO1) assert SOTestSO1.sqlmeta.table in connection.listTables() diff --git a/sqlobject/tests/test_transactions.py b/sqlobject/tests/test_transactions.py index d469d7e..0fbac42 100644 --- a/sqlobject/tests/test_transactions.py +++ b/sqlobject/tests/test_transactions.py @@ -8,6 +8,16 @@ from sqlobject.tests.dbtest import raises, setupClass, supports ######################################## +try: + support_transactions = supports('transactions') +except NameError: + # The module was imported during documentation building + pass +else: + if not support_transactions: + pytestmark = pytest.mark.skip('') + + class SOTestSOTrans(SQLObject): class sqlmeta: defaultOrder = 'name' @@ -15,8 +25,6 @@ class SOTestSOTrans(SQLObject): def test_transaction(): - if not supports('transactions'): - pytest.skip("Transactions aren't supported") setupClass(SOTestSOTrans) SOTestSOTrans(name='bob') SOTestSOTrans(name='tim') @@ -41,8 +49,6 @@ def test_transaction(): def test_transaction_commit_sync(): - if not supports('transactions'): - pytest.skip("Transactions aren't supported") setupClass(SOTestSOTrans) trans = SOTestSOTrans._connection.transaction() try: @@ -58,8 +64,6 @@ def test_transaction_commit_sync(): def test_transaction_delete(close=False): - if not supports('transactions'): - pytest.skip("Transactions aren't supported") setupClass(SOTestSOTrans) connection = SOTestSOTrans._connection if (connection.dbName == 'sqlite') and connection._memory: http://sourceforge.net/p/sqlobject/sqlobject/ci/da5a72be1c6295c5f643dfe9241851549370900f commit da5a72be1c6295c5f643dfe9241851549370900f Author: Oleg Broytman <ph...@ph...> Date: Sat Jan 14 17:34:06 2017 +0300 Fix flake8 warning: change indent due to shorter class name diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py index 085725c..5142425 100644 --- a/sqlobject/inheritance/tests/test_indexes.py +++ b/sqlobject/inheritance/tests/test_indexes.py @@ -25,9 +25,9 @@ def test_index_get_1(): setupClass([InhPersonIdxGet, InhEmployeeIdxGet, InhSalesManIdxGet]) InhSalesManIdxGet(first_name='Michael', last_name='Pallin', age=65, - security_number=2304, experience=2, skill=10) + security_number=2304, experience=2, skill=10) InhEmployeeIdxGet(first_name='Eric', last_name='Idle', age=63, - security_number=3402, experience=9) + security_number=3402, experience=9) InhPersonIdxGet(first_name='Terry', last_name='Guilliam', age=64) InhPersonIdxGet.pk.get('Michael', 'Pallin') diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py index be22989..e8e1510 100644 --- a/sqlobject/tests/test_cyclic_reference.py +++ b/sqlobject/tests/test_cyclic_reference.py @@ -40,10 +40,10 @@ def test_cyclic_reference(): assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table) constraints = SOTestCyclicRefA.createTable(ifNotExists=True, - applyConstraints=False) + applyConstraints=False) assert conn.tableExists(SOTestCyclicRefA.sqlmeta.table) constraints += SOTestCyclicRefB.createTable(ifNotExists=True, - applyConstraints=False) + applyConstraints=False) assert conn.tableExists(SOTestCyclicRefB.sqlmeta.table) for constraint in constraints: ----------------------------------------------------------------------- Summary of changes: .travis.yml | 4 ++++ appveyor.yml | 4 ++++ docs/News.rst | 8 ++++---- sqlobject/firebird/firebirdconnection.py | 2 +- sqlobject/tests/test_converters.py | 6 +++--- sqlobject/tests/test_decimal.py | 7 ++++--- sqlobject/tests/test_mysql.py | 16 ++++++++++------ sqlobject/tests/test_postgres.py | 19 +++++++++++-------- sqlobject/tests/test_sqlite.py | 25 ++++++++++--------------- sqlobject/tests/test_transactions.py | 16 ++++++++++------ tox.ini | 28 +++++++++++++++++++++++++++- 11 files changed, 88 insertions(+), 47 deletions(-) hooks/post-receive -- SQLObject development repository |