Fix wrong @tempdir invocations in tests

This commit is contained in:
Oleh Prypin
2023-12-03 23:24:50 +01:00
parent df2dffd8a6
commit 2929628a8b
2 changed files with 3 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ class ConfigBaseTests(unittest.TestCase):
self.assertTrue(isinstance(cfg, defaults.MkDocsConfig))
self.assertEqual(cfg.site_name, 'MkDocs Test')
@tempdir
@tempdir()
def test_load_default_file_with_yaml(self, temp_dir):
"""Test that `mkdocs.yml` will be loaded when '--config' is not set."""
with open(os.path.join(temp_dir, 'mkdocs.yaml'), 'w') as config_file:
@@ -125,7 +125,7 @@ class ConfigBaseTests(unittest.TestCase):
self.assertTrue(isinstance(cfg, defaults.MkDocsConfig))
self.assertEqual(cfg.site_name, 'MkDocs Test')
@tempdir
@tempdir()
def test_load_missing_required(self, temp_dir):
"""`site_name` is a required setting."""
with open(os.path.join(temp_dir, 'mkdocs.yml'), 'w') as config_file:

View File

@@ -44,7 +44,7 @@ class LocalizationTests(unittest.TestCase):
)
self.env.install_null_translations.assert_called_once()
@tempdir
@tempdir()
def test_translations_found(self, tdir):
translations = mock.Mock()