Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_options_without_parameters():
options = make_options()
# one of the default parameters tested in the C++ part
assert options.parameter_sets_to_buffer == 1000
def open_connection(configuration,
rows_to_buffer=None,
parameter_sets_to_buffer=100,
**turbodbc_options):
dsn = configuration['data_source_name']
prefer_unicode = configuration.get('prefer_unicode', False)
read_buffer_size = turbodbc.Rows(rows_to_buffer) if rows_to_buffer else turbodbc.Megabytes(1)
options = turbodbc.make_options(read_buffer_size=read_buffer_size,
parameter_sets_to_buffer=parameter_sets_to_buffer,
prefer_unicode=prefer_unicode,
**turbodbc_options)
connection = turbodbc.connect(dsn, turbodbc_options=options, **get_credentials(configuration))
yield connection
connection.close()