31
31
else :
32
32
import ConfigParser as configparser
33
33
34
- FOLLOWER_IDENT = None
35
-
36
34
# late imports
37
35
fixtures = None
38
36
engines = None
@@ -72,8 +70,6 @@ def setup_options(make_option):
72
70
help = "Drop all tables in the target database first" )
73
71
make_option ("--backend-only" , action = "store_true" , dest = "backend_only" ,
74
72
help = "Run only tests marked with __backend__" )
75
- make_option ("--mockpool" , action = "store_true" , dest = "mockpool" ,
76
- help = "Use mock pool (asserts only one connection used)" )
77
73
make_option ("--low-connections" , action = "store_true" ,
78
74
dest = "low_connections" ,
79
75
help = "Use a low number of distinct connections - "
@@ -95,14 +91,6 @@ def setup_options(make_option):
95
91
make_option ("--exclude-tag" , action = "callback" , callback = _exclude_tag ,
96
92
type = "string" ,
97
93
help = "Exclude tests with tag <tag>" )
98
- make_option ("--serverside" , action = "store_true" ,
99
- help = "Turn on server side cursors for PG" )
100
- make_option ("--mysql-engine" , action = "store" ,
101
- dest = "mysql_engine" , default = None ,
102
- help = "Use the specified MySQL storage engine for all tables, "
103
- "default is a db-default/InnoDB combo." )
104
- make_option ("--tableopts" , action = "append" , dest = "tableopts" , default = [],
105
- help = "Add a dialect-specific table option, key=value" )
106
94
make_option ("--write-profiles" , action = "store_true" ,
107
95
dest = "write_profiles" , default = False ,
108
96
help = "Write/update profiling data." )
@@ -115,8 +103,8 @@ def configure_follower(follower_ident):
115
103
database creation.
116
104
117
105
"""
118
- global FOLLOWER_IDENT
119
- FOLLOWER_IDENT = follower_ident
106
+ from sqlalchemy . testing import provision
107
+ provision . FOLLOWER_IDENT = follower_ident
120
108
121
109
122
110
def memoize_important_follower_config (dict_ ):
@@ -177,12 +165,14 @@ def post_begin():
177
165
global util , fixtures , engines , exclusions , \
178
166
assertions , warnings , profiling ,\
179
167
config , testing
180
- from sqlalchemy import testing
181
- from sqlalchemy .testing import fixtures , engines , exclusions , \
182
- assertions , warnings , profiling , config
183
- from sqlalchemy import util
168
+ from sqlalchemy import testing # noqa
169
+ from sqlalchemy .testing import fixtures , engines , exclusions # noqa
170
+ from sqlalchemy .testing import assertions , warnings , profiling # noqa
171
+ from sqlalchemy .testing import config # noqa
172
+ from sqlalchemy import util # noqa
184
173
warnings .setup_filters ()
185
174
175
+
186
176
def _log (opt_str , value , parser ):
187
177
global logging
188
178
if not logging :
@@ -233,12 +223,6 @@ def _setup_options(opt, file_config):
233
223
options = opt
234
224
235
225
236
- @pre
237
- def _server_side_cursors (options , file_config ):
238
- if options .serverside :
239
- db_opts ['server_side_cursors' ] = True
240
-
241
-
242
226
@pre
243
227
def _monkeypatch_cdecimal (options , file_config ):
244
228
if options .cdecimal :
@@ -250,7 +234,7 @@ def _monkeypatch_cdecimal(options, file_config):
250
234
def _engine_uri (options , file_config ):
251
235
from sqlalchemy .testing import config
252
236
from sqlalchemy import testing
253
- from sqlalchemy .testing . plugin import provision
237
+ from sqlalchemy .testing import provision
254
238
255
239
if options .dburi :
256
240
db_urls = list (options .dburi )
@@ -273,19 +257,12 @@ def _engine_uri(options, file_config):
273
257
274
258
for db_url in db_urls :
275
259
cfg = provision .setup_config (
276
- db_url , db_opts , options , file_config , FOLLOWER_IDENT )
260
+ db_url , db_opts , options , file_config , provision . FOLLOWER_IDENT )
277
261
278
262
if not config ._current :
279
263
cfg .set_as_current (cfg , testing )
280
264
281
265
282
- @post
283
- def _engine_pool (options , file_config ):
284
- if options .mockpool :
285
- from sqlalchemy import pool
286
- db_opts ['poolclass' ] = pool .AssertionPool
287
-
288
-
289
266
@post
290
267
def _requirements (options , file_config ):
291
268
@@ -368,19 +345,6 @@ def _prep_testing_database(options, file_config):
368
345
schema = enum ['schema' ])))
369
346
370
347
371
- @post
372
- def _set_table_options (options , file_config ):
373
- from sqlalchemy .testing import schema
374
-
375
- table_options = schema .table_options
376
- for spec in options .tableopts :
377
- key , value = spec .split ('=' )
378
- table_options [key ] = value
379
-
380
- if options .mysql_engine :
381
- table_options ['mysql_engine' ] = options .mysql_engine
382
-
383
-
384
348
@post
385
349
def _reverse_topological (options , file_config ):
386
350
if options .reversetop :
0 commit comments