@@ -33,8 +33,7 @@ def test_default_config(self) -> None:
33
33
34
34
def test_arguments (self ) -> None :
35
35
# Arguments to the constructor are applied to the configuration.
36
- cov = coverage .Coverage (
37
- timid = True , data_file = "fooey.dat" , concurrency = "multiprocessing" )
36
+ cov = coverage .Coverage (timid = True , data_file = "fooey.dat" , concurrency = "multiprocessing" )
38
37
assert cov .config .timid
39
38
assert not cov .config .branch
40
39
assert cov .config .data_file == "fooey.dat"
@@ -69,7 +68,7 @@ def test_named_config_file(self, file_class: FilePathType) -> None:
69
68
70
69
@pytest .mark .parametrize ("filename" , ["pyproject.toml" , ".coveragerc.toml" ])
71
70
def test_toml_config_file (self , filename : str ) -> None :
72
- # A pyproject.toml and coveragerc.toml will be read into the configuration.
71
+ # A pyproject.toml or coveragerc.toml will be read into the configuration.
73
72
self .make_file (filename , """\
74
73
# This is just a bogus toml file for testing.
75
74
[tool.somethingelse]
@@ -268,8 +267,7 @@ def test_environment_vars_in_config(self) -> None:
268
267
cov = coverage .Coverage ()
269
268
assert cov .config .data_file == "hello-world.fooey"
270
269
assert cov .config .branch is True
271
- assert cov .config .exclude_list == [
272
- "the_$one" , "anotherZZZ" , "xZZZy" , "xy" , "huh${X}what" ]
270
+ assert cov .config .exclude_list == ["the_$one" , "anotherZZZ" , "xZZZy" , "xy" , "huh${X}what" ]
273
271
274
272
@pytest .mark .parametrize ("filename" , ["pyproject.toml" , ".coveragerc.toml" ])
275
273
def test_environment_vars_in_toml_config (self , filename : str ) -> None :
@@ -303,8 +301,7 @@ def test_environment_vars_in_toml_config(self, filename: str) -> None:
303
301
assert cov .config .branch is True
304
302
assert cov .config .precision == 3
305
303
assert cov .config .data_file == "hello-world.fooey"
306
- assert cov .config .exclude_list == [
307
- "the_$one" , "anotherZZZ" , "xZZZy" , "xy" , "huh${X}what" ]
304
+ assert cov .config .exclude_list == ["the_$one" , "anotherZZZ" , "xZZZy" , "xy" , "huh${X}what" ]
308
305
309
306
def test_tilde_in_config (self ) -> None :
310
307
# Config entries that are file paths can be tilde-expanded.
@@ -393,8 +390,7 @@ def expanduser(s: str) -> str:
393
390
assert cov .config .lcov_output == "/Users/me/lcov/~foo.lcov"
394
391
assert cov .config .xml_output == "/Users/me/somewhere/xml.out"
395
392
assert cov .config .exclude_list == ["~/data.file" , "~joe/html_dir" ]
396
- assert cov .config .paths == {'mapping' : [
397
- '/Users/me/src' , '/Users/joe/source' ]}
393
+ assert cov .config .paths == {'mapping' : ['/Users/me/src' , '/Users/joe/source' ]}
398
394
399
395
def test_tweaks_after_constructor (self ) -> None :
400
396
# set_option can be used after construction to affect the config.
@@ -450,8 +446,7 @@ def test_tweak_error_checking(self) -> None:
450
446
def test_tweak_plugin_options (self ) -> None :
451
447
# Plugin options have a more flexible syntax.
452
448
cov = coverage .Coverage ()
453
- cov .set_option ("run:plugins" , [
454
- "fooey.plugin" , "xyzzy.coverage.plugin" ])
449
+ cov .set_option ("run:plugins" , ["fooey.plugin" , "xyzzy.coverage.plugin" ])
455
450
cov .set_option ("fooey.plugin:xyzzy" , 17 )
456
451
cov .set_option ("xyzzy.coverage.plugin:plugh" , ["a" , "b" ])
457
452
with pytest .raises (ConfigError , match = "No such option: 'no_such.plugin:foo'" ):
@@ -477,7 +472,7 @@ def test_unknown_option_toml(self, filename: str) -> None:
477
472
[tool.coverage.run]
478
473
xyzzy = 17
479
474
""" )
480
- msg = f "Unrecognized option '\\ [tool.coverage.run\ \ ] xyzzy=' in config file { filename } "
475
+ msg = fr "Unrecognized option '\[tool.coverage.run\] xyzzy=' in config file { filename } "
481
476
with pytest .warns (CoverageWarning , match = msg ):
482
477
_ = coverage .Coverage ()
483
478
@@ -543,8 +538,7 @@ def test_partial_also(self) -> None:
543
538
""" )
544
539
cov = coverage .Coverage ()
545
540
546
- expected = coverage .config .DEFAULT_PARTIAL + \
547
- ["foobar" , "raise .*Error" ]
541
+ expected = coverage .config .DEFAULT_PARTIAL + ["foobar" , "raise .*Error" ]
548
542
assert cov .config .partial_list == expected
549
543
550
544
def test_core_option (self ) -> None :
@@ -736,8 +730,7 @@ def check_config_file_settings_in_other_file(self, fname: str, contents: str) ->
736
730
self .assert_config_settings_are_correct (cov )
737
731
738
732
def test_config_file_settings_in_setupcfg (self ) -> None :
739
- self .check_config_file_settings_in_other_file (
740
- "setup.cfg" , self .SETUP_CFG )
733
+ self .check_config_file_settings_in_other_file ("setup.cfg" , self .SETUP_CFG )
741
734
742
735
def test_config_file_settings_in_toxini (self ) -> None :
743
736
self .check_config_file_settings_in_other_file ("tox.ini" , self .TOX_INI )
@@ -750,12 +743,10 @@ def check_other_config_if_coveragerc_specified(self, fname: str, contents: str)
750
743
self .assert_config_settings_are_correct (cov )
751
744
752
745
def test_config_file_settings_in_setupcfg_if_coveragerc_specified (self ) -> None :
753
- self .check_other_config_if_coveragerc_specified (
754
- "setup.cfg" , self .SETUP_CFG )
746
+ self .check_other_config_if_coveragerc_specified ("setup.cfg" , self .SETUP_CFG )
755
747
756
748
def test_config_file_settings_in_tox_if_coveragerc_specified (self ) -> None :
757
- self .check_other_config_if_coveragerc_specified (
758
- "tox.ini" , self .TOX_INI )
749
+ self .check_other_config_if_coveragerc_specified ("tox.ini" , self .TOX_INI )
759
750
760
751
def check_other_not_read_if_coveragerc (self , fname : str ) -> None :
761
752
"""Check config `fname` is not read if .coveragerc exists."""
0 commit comments