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 ff296ca1f8996fd5a38074a440ac9c1436c7fb0e (commit)
via a0ef0cfaa4d0495bfe58d5652c0e3f008b454bc5 (commit)
via a4cb726354a95d40de803610d2120108dc4dbdc0 (commit)
from 3a880112a5e4219a8bfcee684f2e90a1082c41f0 (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/ff296ca1f8996fd5a38074a440ac9c1436c7fb0e
commit ff296ca1f8996fd5a38074a440ac9c1436c7fb0e
Merge: 3a88011 a0ef0cf
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 8 22:53:11 2015 +0300
Merge pull request #70 from drnlm/isse_44_flake8_E711
Issue 44: flake8 e711 - comparison to None
http://sourceforge.net/p/sqlobject/sqlobject/ci/a0ef0cfaa4d0495bfe58d5652c0e3f008b454bc5
commit a0ef0cfaa4d0495bfe58d5652c0e3f008b454bc5
Author: Neil <ne...@di...>
Date: Sun Feb 8 21:44:49 2015 +0200
Fix typo in comments
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index 74dbb97..ae582bf 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -44,14 +44,14 @@ def test_foreignKey():
assert employee.note.text == "employee"
save_employee = employee
- # comparison to Non needed to build the right SQL expression
+ # comparison to None needed to build the right SQL expression
persons = PersonWithNotes.select(PersonWithNotes.q.noteID != None) # noqa
assert persons.count() == 2
persons = PersonWithNotes.selectBy(noteID=person.note.id)
assert persons.count() == 1
- # comparison to Non needed to build the right SQL expression
+ # comparison to None needed to build the right SQL expression
employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID != None) # noqa
assert employee.count() == 1
diff --git a/sqlobject/inheritance/tests/test_inheritance.py b/sqlobject/inheritance/tests/test_inheritance.py
index 155c892..a699cd7 100644
--- a/sqlobject/inheritance/tests/test_inheritance.py
+++ b/sqlobject/inheritance/tests/test_inheritance.py
@@ -50,21 +50,21 @@ def test_inheritance():
def test_inheritance_select():
setup()
- # comparison to Non needed to build the right SQL expression
+ # comparison to None needed to build the right SQL expression
persons = InheritablePerson.select(InheritablePerson.q.firstName != None) # noqa
assert persons.count() == 2
persons = InheritablePerson.select(InheritablePerson.q.firstName == "phd")
assert persons.count() == 0
- # comparison to Non needed to build the right SQL expression
+ # comparison to None needed to build the right SQL expression
employees = Employee.select(Employee.q.firstName != None) # noqa
assert employees.count() == 1
employees = Employee.select(Employee.q.firstName == "phd")
assert employees.count() == 0
- # comparison to Non needed to build the right SQL expression
+ # comparison to None needed to build the right SQL expression
employees = Employee.select(Employee.q.position != None) # noqa
assert employees.count() == 1
http://sourceforge.net/p/sqlobject/sqlobject/ci/a4cb726354a95d40de803610d2120108dc4dbdc0
commit a4cb726354a95d40de803610d2120108dc4dbdc0
Author: Neil <ne...@di...>
Date: Sun Feb 8 21:42:45 2015 +0200
Fix flake8 E711 - comparison to None should be 'if cond is (not) None:'
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index 92104f7..74dbb97 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -44,13 +44,15 @@ def test_foreignKey():
assert employee.note.text == "employee"
save_employee = employee
- persons = PersonWithNotes.select(PersonWithNotes.q.noteID != None)
+ # comparison to Non needed to build the right SQL expression
+ persons = PersonWithNotes.select(PersonWithNotes.q.noteID != None) # noqa
assert persons.count() == 2
persons = PersonWithNotes.selectBy(noteID=person.note.id)
assert persons.count() == 1
- employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID != None)
+ # comparison to Non needed to build the right SQL expression
+ employee = EmployeeWithNotes.select(PersonWithNotes.q.noteID != None) # noqa
assert employee.count() == 1
persons = PersonWithNotes.selectBy(noteID=person.note.id)
diff --git a/sqlobject/inheritance/tests/test_inheritance.py b/sqlobject/inheritance/tests/test_inheritance.py
index a504d9f..155c892 100644
--- a/sqlobject/inheritance/tests/test_inheritance.py
+++ b/sqlobject/inheritance/tests/test_inheritance.py
@@ -50,19 +50,22 @@ def test_inheritance():
def test_inheritance_select():
setup()
- persons = InheritablePerson.select(InheritablePerson.q.firstName != None)
+ # comparison to Non needed to build the right SQL expression
+ persons = InheritablePerson.select(InheritablePerson.q.firstName != None) # noqa
assert persons.count() == 2
persons = InheritablePerson.select(InheritablePerson.q.firstName == "phd")
assert persons.count() == 0
- employees = Employee.select(Employee.q.firstName != None)
+ # comparison to Non needed to build the right SQL expression
+ employees = Employee.select(Employee.q.firstName != None) # noqa
assert employees.count() == 1
employees = Employee.select(Employee.q.firstName == "phd")
assert employees.count() == 0
- employees = Employee.select(Employee.q.position != None)
+ # comparison to Non needed to build the right SQL expression
+ employees = Employee.select(Employee.q.position != None) # noqa
assert employees.count() == 1
persons = InheritablePerson.selectBy(firstName="Project")
diff --git a/sqlobject/main.py b/sqlobject/main.py
index e206b33..7c05a56 100644
--- a/sqlobject/main.py
+++ b/sqlobject/main.py
@@ -1238,7 +1238,7 @@ class SQLObject(object):
column = self.sqlmeta.columns[name]
results = self._connection._SO_selectOne(self, [column.dbName])
# self._SO_writeLock.release()
- assert results != None, "%s with id %s is not in the database" % (
+ assert results is not None, "%s with id %s is not in the database" % (
self.__class__.__name__, self.id)
value = results[0]
if column.to_python:
diff --git a/sqlobject/tests/test_cache.py b/sqlobject/tests/test_cache.py
index c256da3..b3a7dea 100644
--- a/sqlobject/tests/test_cache.py
+++ b/sqlobject/tests/test_cache.py
@@ -18,10 +18,10 @@ def test_purge1():
assert j == y
x.expire(1, y.__class__)
j = x.get(1, y.__class__)
- assert j == None
+ assert j is None
x.finishPut(y.__class__)
j = x.get(1, y.__class__)
- assert j == None
+ assert j is None
x.finishPut(y.__class__)
diff --git a/sqlobject/tests/test_enum.py b/sqlobject/tests/test_enum.py
index aa89ae1..432d464 100644
--- a/sqlobject/tests/test_enum.py
+++ b/sqlobject/tests/test_enum.py
@@ -45,7 +45,7 @@ def testDefaultNone():
setupClass(EnumWithDefaultNone)
e = EnumWithDefaultNone()
- assert e.l == None
+ assert e.l is None
class EnumWithDefaultOther(SQLObject):
diff --git a/sqlobject/tests/test_sqlbuilder.py b/sqlobject/tests/test_sqlbuilder.py
index 1bc1628..7a3eec7 100644
--- a/sqlobject/tests/test_sqlbuilder.py
+++ b/sqlobject/tests/test_sqlbuilder.py
@@ -33,7 +33,7 @@ def test_Select():
def test_empty_AND():
- assert AND() == None
+ assert AND() is None
assert AND(True) == True
# sqlrepr() is needed because AND() returns an SQLExpression that overrides
-----------------------------------------------------------------------
Summary of changes:
sqlobject/inheritance/tests/test_foreignKey.py | 6 ++++--
sqlobject/inheritance/tests/test_inheritance.py | 9 ++++++---
sqlobject/main.py | 2 +-
sqlobject/tests/test_cache.py | 4 ++--
sqlobject/tests/test_enum.py | 2 +-
sqlobject/tests/test_sqlbuilder.py | 2 +-
6 files changed, 15 insertions(+), 10 deletions(-)
hooks/post-receive
--
SQLObject development repository
|