diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-02-25 09:17:21 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-02-25 09:17:21 +0000 |
| commit | 211d42c8f0a2a5b83f8ee46ecddc7f28584ac138 (patch) | |
| tree | a54fe398c24f91bd92deb43731b8a3e3d5e3fbab /docutils | |
| parent | 9e4dd8e700c3af3a517e3a9ca5ee5e913aa749e0 (diff) | |
| download | docutils-211d42c8f0a2a5b83f8ee46ecddc7f28584ac138.tar.gz | |
Fix r9010.
Patch by Adam Turner.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9013 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/test/data/config_syntax_error.txt | 5 | ||||
| -rwxr-xr-x | docutils/test/test_settings.py | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/docutils/test/data/config_syntax_error.txt b/docutils/test/data/config_syntax_error.txt new file mode 100644 index 000000000..4d2890218 --- /dev/null +++ b/docutils/test/data/config_syntax_error.txt @@ -0,0 +1,5 @@ +# Test reporting of config file syntax error + +[general] + +strip-classes: myclass, No*class diff --git a/docutils/test/test_settings.py b/docutils/test/test_settings.py index 83213757e..ac6fcd52f 100755 --- a/docutils/test/test_settings.py +++ b/docutils/test/test_settings.py @@ -151,14 +151,14 @@ class ConfigFileTests(unittest.TestCase): def test_old(self): with self.assertWarnsRegex(FutureWarning, - 'The "\[option\]" section is deprecated.'): + r'The "\[option\]" section is deprecated.'): self.files_settings('old') def test_syntax_error(self): with self.assertRaisesRegex( ValueError, 'Error in config file ".*config_syntax_error.txt", ' - 'section "\[general\]"'): + r'section "\[general\]"'): self.files_settings('syntax_error') def test_one(self): @@ -225,10 +225,11 @@ class ConfigEnvVarFileTests(ConfigFileTests): def test_old(self): pass # don't repreat this test - @unittest.skipUnless(os.name, 'posix') + @unittest.skipUnless( + os.name == 'posix', + 'os.path.expanduser() does not use HOME on Windows (since 3.8)') def test_get_standard_config_files(self): os.environ['HOME'] = '/home/parrot' - # os.path.expanduser() no longer uses HOME on Windows (since 3.8) # TODO: set up mock home directory under Windows self.assertEqual(self.option_parser.get_standard_config_files(), ['/etc/docutils.conf', |
