diff --git a/tests/conftest.py b/tests/conftest.py index f6ad054..dab6744 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -43,8 +43,8 @@ def fin(): def pytest_namespace(): - return {'dsn_list': [sqlite, pg, mysql], - 'pg': [pg], 'sqlite': [sqlite], 'mysql': [mysql]} + return {'dsn_list': [sqlite, pg], + 'pg': pg, 'sqlite': sqlite, 'mysql': mysql} @pytest.fixture diff --git a/tests/pep492/test_async_await.py b/tests/pep492/test_async_await.py index 2c90b8b..ff96c61 100644 --- a/tests/pep492/test_async_await.py +++ b/tests/pep492/test_async_await.py @@ -1,7 +1,7 @@ import pytest -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_cursor(loop, conn, table): async def go(): @@ -21,7 +21,7 @@ async def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_cursor_lightweight(loop, conn, table): async def go(): @@ -38,7 +38,7 @@ async def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_cursor_awit(loop, conn, table): async def go(): @@ -51,7 +51,7 @@ async def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_connection(loop, conn): async def go(): @@ -64,7 +64,7 @@ async def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_pool_context_manager(loop, pool): async def go(): assert not pool.closed @@ -75,7 +75,7 @@ async def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_pool_context_manager2(loop, pool): async def go(): async with await pool as conn: diff --git a/tests/test_connection.py b/tests/test_connection.py index cf1b0e7..d03a91b 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -19,7 +19,7 @@ def test_connect(loop, conn): assert not conn.closed -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_basic_cursor(conn): cursor = yield from conn.cursor() @@ -29,7 +29,7 @@ def test_basic_cursor(conn): assert resp == 10 -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_default_event_loop(loop, dsn): asyncio.set_event_loop(loop) @@ -38,7 +38,7 @@ def test_default_event_loop(loop, dsn): yield from conn.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_close_twice(conn): yield from conn.close() @@ -46,7 +46,7 @@ def test_close_twice(conn): assert conn.closed -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_execute(conn): cur = yield from conn.execute('SELECT 10;') @@ -56,7 +56,7 @@ def test_execute(conn): assert conn.closed -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_getinfo(conn): data = yield from conn.getinfo(pyodbc.SQL_CREATE_TABLE) @@ -66,7 +66,7 @@ def test_getinfo(conn): assert data in (pg, sqlite, mysql) -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_output_conversion(conn, table): def convert(value): @@ -92,13 +92,13 @@ def convert(value): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_autocommit(loop, connection_maker): conn = connection_maker(loop, autocommit=True) assert conn.autocommit, True -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_rollback(conn): assert not conn.autocommit @@ -125,7 +125,7 @@ def test_rollback(conn): @pytest.mark.skipif(not PY_341, reason="Python 3.3 doesnt support __del__ " "calls from GC") -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test___del__(loop, dsn, recwarn): conn = yield from aioodbc.connect(dsn=dsn, loop=loop) @@ -136,7 +136,7 @@ def test___del__(loop, dsn, recwarn): gc.collect() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_custom_executor(loop, dsn, executor): conn = yield from aioodbc.connect(dsn=dsn, executor=executor, loop=loop) diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 6a52144..5d307fb 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -3,7 +3,7 @@ from pyodbc import OperationalError -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_cursor(conn): cur = yield from conn.cursor() @@ -20,7 +20,7 @@ def test_cursor(conn): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_execute_on_closed_cursor(conn): cur = yield from conn.cursor() @@ -29,7 +29,7 @@ def test_execute_on_closed_cursor(conn): yield from cur.execute('SELECT 1;') -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_close(conn): cur = yield from conn.cursor() @@ -39,7 +39,7 @@ def test_close(conn): assert cur.closed -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_description(conn): cur = yield from conn.cursor() @@ -50,7 +50,7 @@ def test_description(conn): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_description_with_real_table(conn, table): cur = yield from conn.cursor() @@ -62,7 +62,7 @@ def test_description_with_real_table(conn, table): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_rowcount_with_table(conn, table): cur = yield from conn.cursor() @@ -76,7 +76,7 @@ def test_rowcount_with_table(conn, table): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_arraysize(conn): cur = yield from conn.cursor() @@ -86,7 +86,7 @@ def test_arraysize(conn): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_fetchall(conn, table): cur = yield from conn.cursor() @@ -100,7 +100,7 @@ def test_fetchall(conn, table): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_fetchmany(conn, table): cur = yield from conn.cursor() @@ -114,7 +114,7 @@ def test_fetchmany(conn, table): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_fetchone(conn, table): cur = yield from conn.cursor() @@ -126,7 +126,7 @@ def test_fetchone(conn, table): yield from cur.close() -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_tables(conn, table): cur = yield from conn.cursor() @@ -137,7 +137,7 @@ def test_tables(conn, table): assert expectd == tuple(resp[0]), resp -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_cursor_rollback(conn, table): @@ -153,7 +153,7 @@ def test_cursor_rollback(conn, table): assert value is None -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_columns(conn, table): cur = yield from conn.cursor() @@ -167,7 +167,7 @@ def test_columns(conn, table): assert expectd == columns -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) @pytest.mark.run_loop def test_executemany(conn): cur = yield from conn.cursor() @@ -189,7 +189,7 @@ def test_executemany(conn): yield from cur.execute("DROP TABLE t1;") -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_procedures_empty(conn, table): cur = yield from conn.cursor() @@ -198,7 +198,7 @@ def test_procedures_empty(conn, table): assert resp == [] -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_procedureColumns_empty(conn, table): cur = yield from conn.cursor() @@ -207,7 +207,7 @@ def test_procedureColumns_empty(conn, table): assert resp == [] -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_primaryKeys_empty(conn, table): cur = yield from conn.cursor() @@ -216,7 +216,7 @@ def test_primaryKeys_empty(conn, table): assert resp == [] -@pytest.mark.parametrize("dsn", pytest.sqlite) +@pytest.mark.parametrize('dsn', [pytest.sqlite]) @pytest.mark.run_loop def test_foreignKeys_empty(conn, table): cur = yield from conn.cursor() diff --git a/tests/test_pool.py b/tests/test_pool.py index d6cae3a..c788024 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -25,7 +25,7 @@ def test_create_pool2(loop, pool_maker, dsn): assert 10 == pool.freesize -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_acquire(loop, pool): @asyncio.coroutine def go(): @@ -439,7 +439,7 @@ def go(): loop.run_until_complete(go()) -@pytest.mark.parametrize("dsn", pytest.dsn_list) +@pytest.mark.parametrize('dsn', pytest.dsn_list) def test_pool_with_executor(loop, pool_maker, dsn, executor): pool = pool_maker(loop, executor=executor, dsn=dsn, minsize=2, maxsize=2)