@@ -114,8 +114,8 @@ def getlist(self, section: str, option: str) -> List[str]:
114
114
"""
115
115
value_list = self .get (section , option )
116
116
values = []
117
- for value_line in value_list .split (' \n ' ):
118
- for value in value_line .split (',' ):
117
+ for value_line in value_list .split (" \n " ):
118
+ for value in value_line .split ("," ):
119
119
value = value .strip ()
120
120
if value :
121
121
values .append (value )
@@ -150,20 +150,20 @@ def getregexlist(self, section: str, option: str) -> List[str]:
150
150
151
151
# The default line exclusion regexes.
152
152
DEFAULT_EXCLUDE = [
153
- r' #\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)' ,
153
+ r" #\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)" ,
154
154
]
155
155
156
156
# The default partial branch regexes, to be modified by the user.
157
157
DEFAULT_PARTIAL = [
158
- r' #\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)' ,
158
+ r" #\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)" ,
159
159
]
160
160
161
161
# The default partial branch regexes, based on Python semantics.
162
162
# These are any Python branching constructs that can't actually execute all
163
163
# their branches.
164
164
DEFAULT_PARTIAL_ALWAYS = [
165
- ' while (True|1|False|0):' ,
166
- ' if (True|1|False|0):' ,
165
+ " while (True|1|False|0):" ,
166
+ " if (True|1|False|0):" ,
167
167
]
168
168
169
169
@@ -286,7 +286,7 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
286
286
"""
287
287
_ , ext = os .path .splitext (filename )
288
288
cp : TConfigParser
289
- if ext == ' .toml' :
289
+ if ext == " .toml" :
290
290
cp = TomlConfigParser (our_file )
291
291
else :
292
292
cp = HandyConfigParser (our_file )
@@ -328,9 +328,9 @@ def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool)
328
328
)
329
329
330
330
# [paths] is special
331
- if cp .has_section (' paths' ):
332
- for option in cp .options (' paths' ):
333
- self .paths [option ] = cp .getlist (' paths' , option )
331
+ if cp .has_section (" paths" ):
332
+ for option in cp .options (" paths" ):
333
+ self .paths [option ] = cp .getlist (" paths" , option )
334
334
any_set = True
335
335
336
336
# plugins can have options
@@ -370,72 +370,72 @@ def copy(self) -> CoverageConfig:
370
370
# configuration value from the file.
371
371
372
372
# [run]
373
- (' branch' , ' run:branch' , ' boolean' ),
374
- (' command_line' , ' run:command_line' ),
375
- (' concurrency' , ' run:concurrency' , ' list' ),
376
- (' context' , ' run:context' ),
377
- (' cover_pylib' , ' run:cover_pylib' , ' boolean' ),
378
- (' data_file' , ' run:data_file' ),
379
- (' debug' , ' run:debug' , ' list' ),
380
- (' debug_file' , ' run:debug_file' ),
381
- (' disable_warnings' , ' run:disable_warnings' , ' list' ),
382
- (' dynamic_context' , ' run:dynamic_context' ),
383
- (' parallel' , ' run:parallel' , ' boolean' ),
384
- (' plugins' , ' run:plugins' , ' list' ),
385
- (' relative_files' , ' run:relative_files' , ' boolean' ),
386
- (' run_include' , ' run:include' , ' list' ),
387
- (' run_omit' , ' run:omit' , ' list' ),
388
- (' sigterm' , ' run:sigterm' , ' boolean' ),
389
- (' source' , ' run:source' , ' list' ),
390
- (' source_pkgs' , ' run:source_pkgs' , ' list' ),
391
- (' timid' , ' run:timid' , ' boolean' ),
392
- (' _crash' , ' run:_crash' ),
373
+ (" branch" , " run:branch" , " boolean" ),
374
+ (" command_line" , " run:command_line" ),
375
+ (" concurrency" , " run:concurrency" , " list" ),
376
+ (" context" , " run:context" ),
377
+ (" cover_pylib" , " run:cover_pylib" , " boolean" ),
378
+ (" data_file" , " run:data_file" ),
379
+ (" debug" , " run:debug" , " list" ),
380
+ (" debug_file" , " run:debug_file" ),
381
+ (" disable_warnings" , " run:disable_warnings" , " list" ),
382
+ (" dynamic_context" , " run:dynamic_context" ),
383
+ (" parallel" , " run:parallel" , " boolean" ),
384
+ (" plugins" , " run:plugins" , " list" ),
385
+ (" relative_files" , " run:relative_files" , " boolean" ),
386
+ (" run_include" , " run:include" , " list" ),
387
+ (" run_omit" , " run:omit" , " list" ),
388
+ (" sigterm" , " run:sigterm" , " boolean" ),
389
+ (" source" , " run:source" , " list" ),
390
+ (" source_pkgs" , " run:source_pkgs" , " list" ),
391
+ (" timid" , " run:timid" , " boolean" ),
392
+ (" _crash" , " run:_crash" ),
393
393
394
394
# [report]
395
- (' exclude_list' , ' report:exclude_lines' , ' regexlist' ),
396
- (' exclude_also' , ' report:exclude_also' , ' regexlist' ),
397
- (' fail_under' , ' report:fail_under' , ' float' ),
398
- (' format' , ' report:format' , ' boolean' ),
399
- (' ignore_errors' , ' report:ignore_errors' , ' boolean' ),
400
- (' include_namespace_packages' , ' report:include_namespace_packages' , ' boolean' ),
401
- (' partial_always_list' , ' report:partial_branches_always' , ' regexlist' ),
402
- (' partial_list' , ' report:partial_branches' , ' regexlist' ),
403
- (' precision' , ' report:precision' , ' int' ),
404
- (' report_contexts' , ' report:contexts' , ' list' ),
405
- (' report_include' , ' report:include' , ' list' ),
406
- (' report_omit' , ' report:omit' , ' list' ),
407
- (' show_missing' , ' report:show_missing' , ' boolean' ),
408
- (' skip_covered' , ' report:skip_covered' , ' boolean' ),
409
- (' skip_empty' , ' report:skip_empty' , ' boolean' ),
410
- (' sort' , ' report:sort' ),
395
+ (" exclude_list" , " report:exclude_lines" , " regexlist" ),
396
+ (" exclude_also" , " report:exclude_also" , " regexlist" ),
397
+ (" fail_under" , " report:fail_under" , " float" ),
398
+ (" format" , " report:format" , " boolean" ),
399
+ (" ignore_errors" , " report:ignore_errors" , " boolean" ),
400
+ (" include_namespace_packages" , " report:include_namespace_packages" , " boolean" ),
401
+ (" partial_always_list" , " report:partial_branches_always" , " regexlist" ),
402
+ (" partial_list" , " report:partial_branches" , " regexlist" ),
403
+ (" precision" , " report:precision" , " int" ),
404
+ (" report_contexts" , " report:contexts" , " list" ),
405
+ (" report_include" , " report:include" , " list" ),
406
+ (" report_omit" , " report:omit" , " list" ),
407
+ (" show_missing" , " report:show_missing" , " boolean" ),
408
+ (" skip_covered" , " report:skip_covered" , " boolean" ),
409
+ (" skip_empty" , " report:skip_empty" , " boolean" ),
410
+ (" sort" , " report:sort" ),
411
411
412
412
# [html]
413
- (' extra_css' , ' html:extra_css' ),
414
- (' html_dir' , ' html:directory' ),
415
- (' html_skip_covered' , ' html:skip_covered' , ' boolean' ),
416
- (' html_skip_empty' , ' html:skip_empty' , ' boolean' ),
417
- (' html_title' , ' html:title' ),
418
- (' show_contexts' , ' html:show_contexts' , ' boolean' ),
413
+ (" extra_css" , " html:extra_css" ),
414
+ (" html_dir" , " html:directory" ),
415
+ (" html_skip_covered" , " html:skip_covered" , " boolean" ),
416
+ (" html_skip_empty" , " html:skip_empty" , " boolean" ),
417
+ (" html_title" , " html:title" ),
418
+ (" show_contexts" , " html:show_contexts" , " boolean" ),
419
419
420
420
# [xml]
421
- (' xml_output' , ' xml:output' ),
422
- (' xml_package_depth' , ' xml:package_depth' , ' int' ),
421
+ (" xml_output" , " xml:output" ),
422
+ (" xml_package_depth" , " xml:package_depth" , " int" ),
423
423
424
424
# [json]
425
- (' json_output' , ' json:output' ),
426
- (' json_pretty_print' , ' json:pretty_print' , ' boolean' ),
427
- (' json_show_contexts' , ' json:show_contexts' , ' boolean' ),
425
+ (" json_output" , " json:output" ),
426
+ (" json_pretty_print" , " json:pretty_print" , " boolean" ),
427
+ (" json_show_contexts" , " json:show_contexts" , " boolean" ),
428
428
429
429
# [lcov]
430
- (' lcov_output' , ' lcov:output' ),
430
+ (" lcov_output" , " lcov:output" ),
431
431
]
432
432
433
433
def _set_attr_from_config_option (
434
434
self ,
435
435
cp : TConfigParser ,
436
436
attr : str ,
437
437
where : str ,
438
- type_ : str = '' ,
438
+ type_ : str = "" ,
439
439
) -> bool :
440
440
"""Set an attribute on self if it exists in the ConfigParser.
441
441
@@ -444,7 +444,7 @@ def _set_attr_from_config_option(
444
444
"""
445
445
section , option = where .split (":" )
446
446
if cp .has_option (section , option ):
447
- method = getattr (cp , ' get' + type_ )
447
+ method = getattr (cp , " get" + type_ )
448
448
setattr (self , attr , method (section , option ))
449
449
return True
450
450
return False
@@ -548,7 +548,7 @@ def config_files_to_try(config_file: Union[bool, str]) -> List[Tuple[str, bool,
548
548
specified_file = (config_file is not True )
549
549
if not specified_file :
550
550
# No file was specified. Check COVERAGE_RCFILE.
551
- rcfile = os .environ .get (' COVERAGE_RCFILE' )
551
+ rcfile = os .environ .get (" COVERAGE_RCFILE" )
552
552
if rcfile :
553
553
config_file = rcfile
554
554
specified_file = True
@@ -602,10 +602,10 @@ def read_coverage_config(
602
602
603
603
# $set_env.py: COVERAGE_DEBUG - Options for --debug.
604
604
# 3) from environment variables:
605
- env_data_file = os .environ .get (' COVERAGE_FILE' )
605
+ env_data_file = os .environ .get (" COVERAGE_FILE" )
606
606
if env_data_file :
607
607
config .data_file = env_data_file
608
- debugs = os .environ .get (' COVERAGE_DEBUG' )
608
+ debugs = os .environ .get (" COVERAGE_DEBUG" )
609
609
if debugs :
610
610
config .debug .extend (d .strip () for d in debugs .split ("," ))
611
611
0 commit comments