Skip to content

Commit f436a6a

Browse files
committed
Fix failing tests
1 parent e31cb71 commit f436a6a

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

tests/test_cli.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,16 @@ def test_insert_encoding(tmpdir):
19071907
# Using --encoding=latin-1 should work
19081908
good_result = CliRunner().invoke(
19091909
cli.cli,
1910-
["insert", db_path, "places", csv_path, "--encoding", "latin-1", "--csv", "--no-detect-types"],
1910+
[
1911+
"insert",
1912+
db_path,
1913+
"places",
1914+
csv_path,
1915+
"--encoding",
1916+
"latin-1",
1917+
"--csv",
1918+
"--no-detect-types",
1919+
],
19111920
catch_exceptions=False,
19121921
)
19131922
assert good_result.exit_code == 0
@@ -2196,7 +2205,7 @@ def test_import_no_headers(tmpdir, args, tsv):
21962205
csv_file.write("Tracy{sep}Spider{sep}7\n".format(sep=sep))
21972206
result = CliRunner().invoke(
21982207
cli.cli,
2199-
["insert", db_path, "creatures", csv_path] + args,
2208+
["insert", db_path, "creatures", csv_path] + args + ["--no-detect-types"],
22002209
catch_exceptions=False,
22012210
)
22022211
assert result.exit_code == 0, result.output
@@ -2245,7 +2254,16 @@ def test_csv_insert_bom(tmpdir):
22452254
fp.write(b"\xef\xbb\xbfname,age\nCleo,5")
22462255
result = CliRunner().invoke(
22472256
cli.cli,
2248-
["insert", db_path, "broken", bom_csv_path, "--encoding", "utf-8", "--csv", "--no-detect-types"],
2257+
[
2258+
"insert",
2259+
db_path,
2260+
"broken",
2261+
bom_csv_path,
2262+
"--encoding",
2263+
"utf-8",
2264+
"--csv",
2265+
"--no-detect-types",
2266+
],
22492267
catch_exceptions=False,
22502268
)
22512269
assert result.exit_code == 0
@@ -2362,7 +2380,16 @@ def test_upsert_no_detect_types(tmpdir):
23622380
data = "id,name,age,weight\n1,Cleo,6,45.5\n2,Dori,1,3.5"
23632381
result = CliRunner().invoke(
23642382
cli.cli,
2365-
["upsert", db_path, "creatures", "-", "--csv", "--pk", "id", "--no-detect-types"],
2383+
[
2384+
"upsert",
2385+
db_path,
2386+
"creatures",
2387+
"-",
2388+
"--csv",
2389+
"--pk",
2390+
"id",
2391+
"--no-detect-types",
2392+
],
23662393
catch_exceptions=False,
23672394
input=data,
23682395
)

tests/test_cli_insert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def test_insert_csv_tsv(content, options, db_path, tmpdir):
227227
fp.write(content)
228228
result = CliRunner().invoke(
229229
cli.cli,
230-
["insert", db_path, "data", file_path] + options,
230+
["insert", db_path, "data", file_path] + options + ["--no-detect-types"],
231231
catch_exceptions=False,
232232
)
233233
assert result.exit_code == 0
@@ -236,7 +236,7 @@ def test_insert_csv_tsv(content, options, db_path, tmpdir):
236236

237237
@pytest.mark.parametrize("empty_null", (True, False))
238238
def test_insert_csv_empty_null(db_path, empty_null):
239-
options = ["--csv"]
239+
options = ["--csv", "--no-detect-types"]
240240
if empty_null:
241241
options.append("--empty-null")
242242
result = CliRunner().invoke(
@@ -430,7 +430,7 @@ def test_insert_text(db_path):
430430
"options,input",
431431
(
432432
([], '[{"id": "1", "name": "Bob"}, {"id": "2", "name": "Cat"}]'),
433-
(["--csv"], "id,name\n1,Bob\n2,Cat"),
433+
(["--csv", "--no-detect-types"], "id,name\n1,Bob\n2,Cat"),
434434
(["--nl"], '{"id": "1", "name": "Bob"}\n{"id": "2", "name": "Cat"}'),
435435
),
436436
)

tests/test_sniff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_sniff(tmpdir, filepath):
1212
runner = CliRunner()
1313
result = runner.invoke(
1414
cli.cli,
15-
["insert", db_path, "creatures", str(filepath), "--sniff"],
15+
["insert", db_path, "creatures", str(filepath), "--sniff", "--no-detect-types"],
1616
catch_exceptions=False,
1717
)
1818
assert result.exit_code == 0, result.stdout

0 commit comments

Comments
 (0)