diff options
-rw-r--r-- | coverage/config.py | 4 | ||||
-rw-r--r-- | coverage/control.py | 7 | ||||
-rw-r--r-- | tests/test_config.py | 19 |
3 files changed, 2 insertions, 28 deletions
diff --git a/coverage/config.py b/coverage/config.py index 6372f4c0..f20ef90d 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -467,10 +467,6 @@ def config_files_to_try(config_file): (filename, is_our_file, was_file_specified) """ - # Some API users were specifying ".coveragerc" to mean the same as - # True, so make it so. - if config_file == ".coveragerc": - config_file = True specified_file = (config_file is not True) if not specified_file: # No file was specified. Check COVERAGE_RCFILE. diff --git a/coverage/control.py b/coverage/control.py index 53942242..d9272fc6 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -126,15 +126,12 @@ class Coverage(object): `config_file` determines what configuration file to read: - * If it is ".coveragerc", it is interpreted as if it were True, - for backward compatibility. - * If it is a string, it is the name of the file to read. If the file can't be read, it is an error. * If it is True, then a few standard files names are tried - (".coveragerc", "setup.cfg", "tox.ini"). It is not an error for - these files to not be found. + (".coveragerc", "setup.cfg", "tox.ini", "pyproject.toml"). + It is not an error for these files to not be found. * If it is False, then no configuration file is read. diff --git a/tests/test_config.py b/tests/test_config.py index fe9e001e..1b9a4137 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -575,19 +575,6 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): def test_config_file_settings_in_toxini(self): self.check_config_file_settings_in_other_file("tox.ini", self.TOX_INI) - def check_other_config_if_coveragerc_specified(self, fname, contents): - """Check that config `fname` is read if .coveragerc is missing, but specified.""" - nested = self.LOTSA_SETTINGS.format(section="coverage:") - self.make_file(fname, nested + "\n" + contents) - cov = coverage.Coverage(config_file=".coveragerc") - self.assert_config_settings_are_correct(cov) - - def test_config_file_settings_in_setupcfg_if_coveragerc_specified(self): - self.check_other_config_if_coveragerc_specified("setup.cfg", self.SETUP_CFG) - - def test_config_file_settings_in_tox_if_coveragerc_specified(self): - self.check_other_config_if_coveragerc_specified("tox.ini", self.TOX_INI) - def check_other_not_read_if_coveragerc(self, fname): """Check config `fname` is not read if .coveragerc exists.""" self.make_file(".coveragerc", """\ @@ -671,12 +658,6 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): with self.assertRaisesRegex(CoverageException, msg): coverage.Coverage(config_file=bad_file) - def test_nocoveragerc_file_when_specified(self): - cov = coverage.Coverage(config_file=".coveragerc") - self.assertFalse(cov.config.timid) - self.assertFalse(cov.config.branch) - self.assertEqual(cov.config.data_file, ".coverage") - def test_no_toml_installed_no_toml(self): # Can't read a toml file that doesn't exist. with coverage.optional.without('toml'): |