@@ -49,7 +49,7 @@ def test_convert_code(fresh_db_and_path, code):
49
49
result = CliRunner ().invoke (
50
50
cli .cli , ["convert" , db_path , "t" , "text" , code ], catch_exceptions = False
51
51
)
52
- assert 0 == result . exit_code , result .output
52
+ assert result . exit_code == 0 , result .output
53
53
value = list (db ["t" ].rows )[0 ]["text" ]
54
54
assert value == "Spooktober"
55
55
@@ -67,7 +67,7 @@ def test_convert_code_errors(fresh_db_and_path, bad_code):
67
67
result = CliRunner ().invoke (
68
68
cli .cli , ["convert" , db_path , "t" , "text" , bad_code ], catch_exceptions = False
69
69
)
70
- assert 1 == result . exit_code
70
+ assert result . exit_code == 1
71
71
assert result .output == "Error: Could not compile code\n "
72
72
73
73
@@ -85,7 +85,7 @@ def test_convert_import(test_db_and_path):
85
85
"re" ,
86
86
],
87
87
)
88
- assert 0 == result . exit_code , result .output
88
+ assert result . exit_code == 0 , result .output
89
89
assert [
90
90
{"id" : 1 , "dt" : "5th OXXober 2019 12:04" },
91
91
{"id" : 2 , "dt" : "6th OXXober 2019 00:05:06" },
@@ -109,7 +109,7 @@ def test_convert_import_nested(fresh_db_and_path):
109
109
"xml.etree.ElementTree" ,
110
110
],
111
111
)
112
- assert 0 == result . exit_code , result .output
112
+ assert result . exit_code == 0 , result .output
113
113
assert [
114
114
{"xml" : "Cleo" },
115
115
] == list (db ["example" ].rows )
@@ -230,7 +230,7 @@ def test_convert_output_column(test_db_and_path, drop):
230
230
if drop :
231
231
args += ["--drop" ]
232
232
result = CliRunner ().invoke (cli .cli , args )
233
- assert 0 == result . exit_code , result .output
233
+ assert result . exit_code == 0 , result .output
234
234
expected = [
235
235
{
236
236
"id" : 1 ,
@@ -277,7 +277,7 @@ def test_convert_output_column_output_type(test_db_and_path, output_type, expect
277
277
cli .cli ,
278
278
args ,
279
279
)
280
- assert 0 == result . exit_code , result .output
280
+ assert result . exit_code == 0 , result .output
281
281
assert expected == list (db .execute ("select id, new_id from example" ))
282
282
283
283
@@ -428,7 +428,7 @@ def test_recipe_jsonsplit(tmpdir, delimiter):
428
428
code = 'recipes.jsonsplit(value, delimiter="{}")' .format (delimiter )
429
429
args = ["convert" , db_path , "example" , "tags" , code ]
430
430
result = CliRunner ().invoke (cli .cli , args )
431
- assert 0 == result . exit_code , result .output
431
+ assert result . exit_code == 0 , result .output
432
432
assert list (db ["example" ].rows ) == [
433
433
{"id" : 1 , "tags" : '["foo", "bar"]' },
434
434
{"id" : 2 , "tags" : '["bar", "baz"]' },
@@ -456,7 +456,7 @@ def test_recipe_jsonsplit_type(fresh_db_and_path, type, expected_array):
456
456
code = "recipes.jsonsplit(value, type={})" .format (type )
457
457
args = ["convert" , db_path , "example" , "records" , code ]
458
458
result = CliRunner ().invoke (cli .cli , args )
459
- assert 0 == result . exit_code , result .output
459
+ assert result . exit_code == 0 , result .output
460
460
assert json .loads (db ["example" ].get (1 )["records" ]) == expected_array
461
461
462
462
@@ -474,7 +474,7 @@ def test_recipe_jsonsplit_output(fresh_db_and_path, drop):
474
474
if drop :
475
475
args += ["--drop" ]
476
476
result = CliRunner ().invoke (cli .cli , args )
477
- assert 0 == result . exit_code , result .output
477
+ assert result . exit_code == 0 , result .output
478
478
expected = {
479
479
"id" : 1 ,
480
480
"records" : "1,2,3" ,
@@ -568,7 +568,7 @@ def test_convert_where_multi(fresh_db_and_path):
568
568
"--multi" ,
569
569
],
570
570
)
571
- assert 0 == result . exit_code , result .output
571
+ assert result . exit_code == 0 , result .output
572
572
assert list (db ["names" ].rows ) == [
573
573
{"id" : 1 , "name" : "Cleo" , "upper" : None },
574
574
{"id" : 2 , "name" : "Bants" , "upper" : "BANTS" },
@@ -589,7 +589,7 @@ def test_convert_code_standard_input(fresh_db_and_path):
589
589
],
590
590
input = "value.upper()" ,
591
591
)
592
- assert 0 == result . exit_code , result .output
592
+ assert result . exit_code == 0 , result .output
593
593
assert list (db ["names" ].rows ) == [
594
594
{"id" : 1 , "name" : "CLEO" },
595
595
]
@@ -602,7 +602,7 @@ def test_convert_hyphen_workaround(fresh_db_and_path):
602
602
cli .cli ,
603
603
["convert" , db_path , "names" , "name" , '"-"' ],
604
604
)
605
- assert 0 == result . exit_code , result .output
605
+ assert result . exit_code == 0 , result .output
606
606
assert list (db ["names" ].rows ) == [
607
607
{"id" : 1 , "name" : "-" },
608
608
]
@@ -622,7 +622,7 @@ def test_convert_initialization_pattern(fresh_db_and_path):
622
622
],
623
623
input = "import random\n random.seed(1)\n def convert(value): return random.randint(0, 100)" ,
624
624
)
625
- assert 0 == result . exit_code , result .output
625
+ assert result . exit_code == 0 , result .output
626
626
assert list (db ["names" ].rows ) == [
627
627
{"id" : 1 , "name" : "17" },
628
628
]
@@ -650,6 +650,6 @@ def test_convert_no_skip_false(fresh_db_and_path, no_skip_false, expected):
650
650
assert db ["t" ].get (1 )["x" ] == 0
651
651
assert db ["t" ].get (2 )["x" ] == 1
652
652
result = CliRunner ().invoke (cli .cli , args , input = "value + 1" )
653
- assert 0 == result . exit_code , result .output
653
+ assert result . exit_code == 0 , result .output
654
654
assert db ["t" ].get (1 )["x" ] == expected
655
655
assert db ["t" ].get (2 )["x" ] == 2
0 commit comments