You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added JDBC/Jython support. Requires jython2.5.0 (older releases
of Jython have not been tested).
Added logic to drop table to handle JDBC.
Cleaned up sqlstate check for IngresDBI in drop table.
Cleaned up spurious trace setting line in pooled check.
Added setUpOnce() function to make clear what is single
setup for the whole suite.
Removed semi-colons ";" from SQL, DBMS/JDBC-driver does not like it.
Connection defaults are all specified in one place.
git-svn-id: http://code.ingres.com/ingres/drivers/python/main@1883 45b5d43f-8932-4c86-835a-3654e5842839
table_prefix='dbapi20test_'# If you need to specify a prefix for tables
157
208
158
209
lower_func='lower'# For stored procedure test
159
210
160
-
defsetUp(self):
161
-
# NOTE using Python unittest, setUp() is called before EACH and every
162
-
# test. There is no single setup routine hook (other than hacking init,
163
-
# module main, etc.). Setup is done here in case an external test
164
-
# suite runner is used (e.g. nose, py.test, etc.). So far all the
165
-
# setup implemented here is single setup that only needs to be done
166
-
# once at the start of the complete test run.
167
-
#
168
-
# Call superclass setUp In case this does something in the
169
-
# future
170
-
dbapi20.DatabaseAPI20Test.setUp(self)
171
-
172
-
dbname=self.connect_kw_args['database']
173
-
211
+
defsetUpOnce(self):
212
+
"""Custom, one shot custom setup issued only once for the entire batch of tests
213
+
NOTE actually runs for every test if it fails......
214
+
"""
215
+
globalglobalsetUpOnceFlag
216
+
ifglobalsetUpOnceFlag:
217
+
return
218
+
219
+
ifjython_runtime_detected:
220
+
dbname=database# not sure about this
221
+
else:
222
+
dbname=self.connect_kw_args['database']
174
223
try:
175
224
con=self._connect()
176
-
exceptingresdbi.DataError:
225
+
exceptself.driver.DataError:
177
226
cmd="createdb -i %s -f nofeclients"%dbname
178
227
cout,cin=popen2.popen2(cmd)
179
228
cin.close()
@@ -203,6 +252,23 @@ def setUp(self):
203
252
rs=cur.fetchone()
204
253
self.assertEqual(rs[0], 'NFC', 'Test database "%s" needs to use NFC UNICODE_NORMALIZATION (i.e. "createdb -i ...")'%dbname) # this probably should be made more obvious in the error output!
205
254
con.close()
255
+
# set complete flag AFTER everything has been done successfully
256
+
globalsetUpOnceFlag=True
257
+
258
+
defsetUp(self):
259
+
# NOTE using Python unittest, setUp() is called before EACH and every
260
+
# test. There is no single setup routine hook (other than hacking init,
261
+
# module main, etc.). Setup is done here in case an external test
262
+
# suite runner is used (e.g. nose, py.test, etc.).
263
+
264
+
# Call superclass setUp In case this does something in the
265
+
# future
266
+
dbapi20.DatabaseAPI20Test.setUp(self)
267
+
268
+
# ensure intial setup complete
269
+
self.setUpOnce()
270
+
271
+
# end of setUp() there is no per test setup required.
0 commit comments