17
17
@pytest .mark .parametrize (
18
18
"kwargs,msg" ,
19
19
[
20
- (dict ( quotechar = " foo") , '"quotechar" must be a(n)? 1-character string' ),
20
+ ({ " quotechar" : " foo"} , '"quotechar" must be a(n)? 1-character string' ),
21
21
(
22
- dict ( quotechar = None , quoting = csv .QUOTE_MINIMAL ) ,
22
+ { " quotechar" : None , " quoting" : csv .QUOTE_MINIMAL } ,
23
23
"quotechar must be set if quoting enabled" ,
24
24
),
25
- (dict ( quotechar = 2 ) , '"quotechar" must be string, not int' ),
25
+ ({ " quotechar" : 2 } , '"quotechar" must be string, not int' ),
26
26
],
27
27
)
28
28
def test_bad_quote_char (all_parsers , kwargs , msg ):
@@ -72,7 +72,7 @@ def test_quote_char_various(all_parsers, quote_char):
72
72
@pytest .mark .parametrize ("quoting" , [csv .QUOTE_MINIMAL , csv .QUOTE_NONE ])
73
73
@pytest .mark .parametrize ("quote_char" , ["" , None ])
74
74
def test_null_quote_char (all_parsers , quoting , quote_char ):
75
- kwargs = dict ( quotechar = quote_char , quoting = quoting )
75
+ kwargs = { " quotechar" : quote_char , " quoting" : quoting }
76
76
data = "a,b,c\n 1,2,3"
77
77
parser = all_parsers
78
78
@@ -91,17 +91,17 @@ def test_null_quote_char(all_parsers, quoting, quote_char):
91
91
@pytest .mark .parametrize (
92
92
"kwargs,exp_data" ,
93
93
[
94
- (dict () , [[1 , 2 , "foo" ]]), # Test default.
94
+ ({} , [[1 , 2 , "foo" ]]), # Test default.
95
95
# QUOTE_MINIMAL only applies to CSV writing, so no effect on reading.
96
- (dict ( quotechar = '"' , quoting = csv .QUOTE_MINIMAL ) , [[1 , 2 , "foo" ]]),
96
+ ({ " quotechar" : '"' , " quoting" : csv .QUOTE_MINIMAL } , [[1 , 2 , "foo" ]]),
97
97
# QUOTE_MINIMAL only applies to CSV writing, so no effect on reading.
98
- (dict ( quotechar = '"' , quoting = csv .QUOTE_ALL ) , [[1 , 2 , "foo" ]]),
98
+ ({ " quotechar" : '"' , " quoting" : csv .QUOTE_ALL } , [[1 , 2 , "foo" ]]),
99
99
# QUOTE_NONE tells the reader to do no special handling
100
100
# of quote characters and leave them alone.
101
- (dict ( quotechar = '"' , quoting = csv .QUOTE_NONE ) , [[1 , 2 , '"foo"' ]]),
101
+ ({ " quotechar" : '"' , " quoting" : csv .QUOTE_NONE } , [[1 , 2 , '"foo"' ]]),
102
102
# QUOTE_NONNUMERIC tells the reader to cast
103
103
# all non-quoted fields to float
104
- (dict ( quotechar = '"' , quoting = csv .QUOTE_NONNUMERIC ) , [[1.0 , 2.0 , "foo" ]]),
104
+ ({ " quotechar" : '"' , " quoting" : csv .QUOTE_NONNUMERIC } , [[1.0 , 2.0 , "foo" ]]),
105
105
],
106
106
)
107
107
def test_quoting_various (all_parsers , kwargs , exp_data ):
0 commit comments