summaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index dd86303f..4225540c 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -10,9 +10,9 @@ import mock
import coverage
from coverage.misc import CoverageException
-import coverage.optional
from tests.coveragetest import CoverageTest, UsingModulesMixin
+from tests.helpers import without_module
class ConfigTest(CoverageTest):
@@ -712,7 +712,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest):
def test_no_toml_installed_no_toml(self):
# Can't read a toml file that doesn't exist.
- with coverage.optional.without('toml'):
+ with without_module(coverage.tomlconfig, 'toml'):
msg = "Couldn't read 'cov.toml' as a config file"
with self.assertRaisesRegex(CoverageException, msg):
coverage.Coverage(config_file="cov.toml")
@@ -720,7 +720,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest):
def test_no_toml_installed_explicit_toml(self):
# Can't specify a toml config file if toml isn't installed.
self.make_file("cov.toml", "# A toml file!")
- with coverage.optional.without('toml'):
+ with without_module(coverage.tomlconfig, 'toml'):
msg = "Can't read 'cov.toml' without TOML support"
with self.assertRaisesRegex(CoverageException, msg):
coverage.Coverage(config_file="cov.toml")
@@ -732,7 +732,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest):
[tool.coverage.run]
xyzzy = 17
""")
- with coverage.optional.without('toml'):
+ with without_module(coverage.tomlconfig, 'toml'):
msg = "Can't read 'pyproject.toml' without TOML support"
with self.assertRaisesRegex(CoverageException, msg):
coverage.Coverage()
@@ -744,7 +744,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest):
[tool.something]
xyzzy = 17
""")
- with coverage.optional.without('toml'):
+ with without_module(coverage.tomlconfig, 'toml'):
cov = coverage.Coverage()
# We get default settings:
self.assertFalse(cov.config.timid)