Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Sep 10, 2023
1 parent 0728bfb commit 62af81e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion simplesqlite/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(
delayed_connection: bool = True,
max_workers: Optional[int] = None,
profile: bool = False,
**connect_kwargs: Any
**connect_kwargs: Any,
) -> None:
self.debug_query = False

Expand Down
30 changes: 26 additions & 4 deletions test/test_simplesqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@


class Test_SimpleSQLite_init:
@pytest.mark.parametrize(["mode"], [["w"], ["a"]])
@pytest.mark.parametrize(
["mode"],
[
["w"],
["a"],
],
)
def test_normal_path(self, tmpdir, mode):
p = tmpdir.join("test.sqlite3")
db_path = str(p)
Expand All @@ -60,7 +66,13 @@ def test_normal_path(self, tmpdir, mode):
assert con.database_path == db_path
assert con.connection is not None

@pytest.mark.parametrize(["mode"], [["w"], ["a"]])
@pytest.mark.parametrize(
["mode"],
[
["w"],
["a"],
],
)
def test_normal_con(self, mode):
con = SimpleSQLite(connect_memdb().connection, mode)
assert con.database_path is None
Expand Down Expand Up @@ -96,7 +108,12 @@ def test_exception_invalid_arg(self, value, mode, expected):
SimpleSQLite(value, mode).connection

@pytest.mark.parametrize(
["mode", "expected"], [["r", DatabaseError], ["w", DatabaseError], ["a", DatabaseError]]
["mode", "expected"],
[
["r", DatabaseError],
["w", DatabaseError],
["a", DatabaseError],
],
)
def test_exception_invalid_file(self, tmpdir, mode, expected):
p = tmpdir.join("testdata.txt")
Expand Down Expand Up @@ -393,7 +410,12 @@ def test_normal(self, con):


class Test_SimpleSQLite_fetch_attr_names:
@pytest.mark.parametrize(["value", "expected"], [[TEST_TABLE_NAME, ["attr_a", "attr_b"]]])
@pytest.mark.parametrize(
["value", "expected"],
[
[TEST_TABLE_NAME, ["attr_a", "attr_b"]],
],
)
def test_normal(self, con, value, expected):
assert con.fetch_attr_names(value) == expected

Expand Down

0 comments on commit 62af81e

Please sign in to comment.