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 570cf8d5a43d4a6aeacaa4f1ebb6e92f09d35fbb (commit)
from dc3ff012c220b6ee44a0ede7b467de4c0f5167b8 (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/570cf8d5a43d4a6aeacaa4f1ebb6e92f09d35fbb
commit 570cf8d5a43d4a6aeacaa4f1ebb6e92f09d35fbb
Author: Oleg Broytman <ph...@ph...>
Date: Wed Feb 27 00:36:46 2019 +0300
Tests: Fix DeprecationWarning from pytest.raises(..., "code")
diff --git a/sqlobject/tests/test_select.py b/sqlobject/tests/test_select.py
index 41ef0ef..3a0055e 100644
--- a/sqlobject/tests/test_select.py
+++ b/sqlobject/tests/test_select.py
@@ -108,10 +108,10 @@ def test_select_getOne():
assert IterTest.selectBy(name='a').getOne() == a
assert IterTest.select(IterTest.q.name == 'b').getOne() == b
assert IterTest.selectBy(name='c').getOne(None) is None
- raises(SQLObjectNotFound, 'IterTest.selectBy(name="c").getOne()')
+ raises(SQLObjectNotFound, IterTest.selectBy(name="c").getOne)
IterTest(name='b')
- raises(SQLObjectIntegrityError, 'IterTest.selectBy(name="b").getOne()')
- raises(SQLObjectIntegrityError, 'IterTest.selectBy(name="b").getOne(None)')
+ raises(SQLObjectIntegrityError, IterTest.selectBy(name="b").getOne)
+ raises(SQLObjectIntegrityError, IterTest.selectBy(name="b").getOne, None)
def test_selectBy():
diff --git a/sqlobject/tests/test_select_through.py b/sqlobject/tests/test_select_through.py
index b043a03..4852a34 100644
--- a/sqlobject/tests/test_select_through.py
+++ b/sqlobject/tests/test_select_through.py
@@ -40,7 +40,8 @@ def setup_module(mod):
def testBadRef():
- pytest.raises(AttributeError, 'threes[0].throughTo.four')
+ with pytest.raises(AttributeError):
+ threes[0].throughTo.four
def testThroughFK():
diff --git a/sqlobject/tests/test_transactions.py b/sqlobject/tests/test_transactions.py
index b9ac500..56ce7f8 100644
--- a/sqlobject/tests/test_transactions.py
+++ b/sqlobject/tests/test_transactions.py
@@ -109,8 +109,9 @@ def test_transaction_delete(close=False):
bOutID = bOutInst.id # noqa: bOutID is used in the string code below
trans.commit(close=close)
assert bOut.count() == 0
- raises(SQLObjectNotFound, "SOTestSOTrans.get(bOutID)")
- raises(SQLObjectNotFound, "bOutInst.name")
+ raises(SQLObjectNotFound, SOTestSOTrans.get, bOutID)
+ with raises(SQLObjectNotFound):
+ bOutInst.name
finally:
trans.rollback()
connection.autoCommit = True
-----------------------------------------------------------------------
Summary of changes:
sqlobject/tests/test_select.py | 6 +++---
sqlobject/tests/test_select_through.py | 3 ++-
sqlobject/tests/test_transactions.py | 5 +++--
3 files changed, 8 insertions(+), 6 deletions(-)
hooks/post-receive
--
SQLObject development repository
|