File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 1616 package_dir = {"" : "src" },
1717 packages = ["cs50" ],
1818 url = "https://github.com/cs50/python-cs50" ,
19- version = "7.0.0 "
19+ version = "7.0.1 "
2020)
Original file line number Diff line number Diff line change @@ -66,9 +66,7 @@ def escape(self, value):
6666 return sqlparse .sql .Token (sqlparse .tokens .String , string_processor (value ))
6767
6868 if value is None :
69- return sqlparse .sql .Token (
70- sqlparse .tokens .Keyword ,
71- sqlalchemy .types .NullType ().literal_processor (self ._dialect )(value ))
69+ return sqlparse .sql .Token (sqlparse .tokens .Keyword , "NULL" )
7270
7371 raise RuntimeError (f"unsupported value: { value } " )
7472
Original file line number Diff line number Diff line change @@ -132,19 +132,10 @@ def test_identifier_case(self):
132132 self .assertIn ("count" , self .db .execute ("SELECT 1 AS count" )[0 ])
133133
134134 def tearDown (self ):
135- self .db .execute ("DROP TABLE cs50" )
135+ self .db .execute ("DROP TABLE IF EXISTS cs50" )
136136 self .db .execute ("DROP TABLE IF EXISTS foo" )
137137 self .db .execute ("DROP TABLE IF EXISTS bar" )
138138
139- @classmethod
140- def tearDownClass (self ):
141- try :
142- self .db .execute ("DROP TABLE IF EXISTS cs50" )
143- except Warning as e :
144- # suppress "unknown table"
145- if not str (e ).startswith ("(1051" ):
146- raise e
147-
148139class MySQLTests (SQLTests ):
149140 @classmethod
150141 def setUpClass (self ):
@@ -317,6 +308,10 @@ def test_numeric(self):
317308 def test_cte (self ):
318309 self .assertEqual (self .db .execute ("WITH foo AS ( SELECT 1 AS bar ) SELECT bar FROM foo" ), [{"bar" : 1 }])
319310
311+ def test_none (self ):
312+ self .db .execute ("CREATE TABLE foo (val INTEGER)" )
313+ self .db .execute ("SELECT * FROM foo WHERE val = ?" , None )
314+
320315if __name__ == "__main__" :
321316 suite = unittest .TestSuite ([
322317 unittest .TestLoader ().loadTestsFromTestCase (SQLiteTests ),
You can’t perform that action at this time.
0 commit comments