Skip to content

Instantly share code, notes, and snippets.

@mmulich
Created September 4, 2015 19:52
Show Gist options
  • Save mmulich/6286546d7e12f77eabfc to your computer and use it in GitHub Desktop.
Save mmulich/6286546d7e12f77eabfc to your computer and use it in GitHub Desktop.

Revisions

  1. Michael Mulich created this gist Sep 4, 2015.
    44 changes: 44 additions & 0 deletions diff.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    diff --git a/tests/common/db/test_util.py b/tests/common/db/test_util.py
    index 73bc090..76152de 100644
    --- a/tests/common/db/test_util.py
    +++ b/tests/common/db/test_util.py
    @@ -3,6 +3,7 @@
    :copyright: (c) 2015 Rice University.
    :author: pumazi.
    """
    +import pytest
    import sqlalchemy as db

    from biglearn.common.db.util import (
    @@ -14,6 +15,22 @@ from biglearn.common.db.util import (
    make_table_with_created,
    )

    +from .helpers import (
    + dummy_tbl_name,
    + dummy_col_name,
    + dummy_col,
    + t,
    + uri,
    +)
    +
    +
    +@pytest.yield_fixture
    +def conn():
    + sqlalchemy_uri = uri()
    + from biglearn.common.db.connect import Executor
    + with Executor(sqlalchemy_uri) as conn:
    + yield conn
    +

    metadata = db.MetaData()

    @@ -39,3 +56,8 @@ def test_make_table_with_created():
    # since the table already exists, the additional_column shouldn't
    # be in the definition.
    assert created_t == adden_t
    +
    +
    +def test_batch_insert(conn, t):
    + import pdb; pdb.set_trace()
    + batch_insert(conn, lst, batch_size, transformer, table)