Mercurial > p > roundup > code
comparison test/test_config.py @ 8570:16e8bacb8f90
test: strftime formats; Runtime v Parsing error config.ini windows python
strftime formats like "%2d" are not supported by windows python.
So limit testing to non-win32 platform.
In tests RuntimeError (not ParsingError) was returned for an invalid
config.ini parse error with 3.12 and newer. Windows Python 3.11.4
returns RuntimeError as well. Changed guard that chooses RuntimeError
to 3.11.4 or newer.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 13 Apr 2026 13:28:58 -0400 |
| parents | f7fadbac5856 |
| children |
comparison
equal
deleted
inserted
replaced
| 8569:4006ddad6b8a | 8570:16e8bacb8f90 |
|---|---|
| 1719 # default log config doesn't define handlers for roundup.http | 1719 # default log config doesn't define handlers for roundup.http |
| 1720 self.assertEqual(len(logging.getLogger('roundup.http').handlers), 0) | 1720 self.assertEqual(len(logging.getLogger('roundup.http').handlers), 0) |
| 1721 | 1721 |
| 1722 output = cm.exception.args[0].replace(r'\\','\\') | 1722 output = cm.exception.args[0].replace(r'\\','\\') |
| 1723 | 1723 |
| 1724 if sys.version_info >= (3, 12, 0): | 1724 if sys.version_info >= (3, 11, 4): |
| 1725 expected = ( | 1725 expected = ( |
| 1726 "Error loading logging config from %(filename)s.\n\n" | 1726 "Error loading logging config from %(filename)s.\n\n" |
| 1727 " RuntimeError: %(filename)s is invalid: Source contains parsing errors: " | 1727 " RuntimeError: %(filename)s is invalid: Source contains parsing errors: " |
| 1728 "'%(filename)s'\n\t[line 9]: '=foo\\n'\n\n" | 1728 "'%(filename)s'\n\t[line 9]: '=foo\\n'\n\n" |
| 1729 "Source contains parsing errors: '%(filename)s'\n" | 1729 "Source contains parsing errors: '%(filename)s'\n" |
| 1730 "\t[line 9]: '=foo\\n' Unspecified run-time error.\n" % | 1730 "\t[line 9]: '=foo\\n' Unspecified run-time error.\n" % |
| 1731 {"filename": log_config_filename}) | 1731 {"filename": log_config_filename}) |
| 1732 | 1732 |
| 1733 else: # 3.7 <= x < 3.12.0 | 1733 else: # 3.7 <= x < 3.12.0 |
| 1734 | |
| 1735 expected = ( | 1734 expected = ( |
| 1736 "Error loading logging config from %(filename)s.\n\n" | 1735 "Error loading logging config from %(filename)s.\n\n" |
| 1737 " ParsingError: Source contains parsing errors: " | 1736 " ParsingError: Source contains parsing errors: " |
| 1738 "'%(filename)s'\n" | 1737 "'%(filename)s'\n" |
| 1739 "\t[line 9]: '=foo\\n'\n\n" | 1738 "\t[line 9]: '=foo\\n'\n\n" |
