Modify ↓
Opened 3 years ago
Closed 3 years ago
#13577 closed defect (fixed)
FAIL: test_pretty_dateinfo without Babel on windows-2022 image
| Reported by: | Jun Omae | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.6 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: |
Fixed test failing due to |
||
Description
https://github.com/edgewall/trac/actions/runs/4409640379/jobs/7726313888
======================================================================
FAIL: test_pretty_dateinfo (trac.web.tests.chrome.ChromeTemplateRenderingTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\a\trac\trac\trac\web\tests\chrome.py", line 1118, in test_pretty_dateinfo
self.assertRegex(content, textwrap.dedent("""\
AssertionError: Regex didn't match: '<!DOCTYPE html>\n<html>\n<body>\n<ul>\n<li></li>\n<li><span title="07/01/(20)?07 12:34:56">[0-9]+ years ago</span></li>\n<li><span title="07/01/(20)?07 12:34:56">[0-9]+ years ago</span></li>\n<li><span title="[0-9]+ years ago">on 07/01/(20)?07</span></li>\n<li><span title="[0-9]+ years ago">on 07/01/(20)?07 at 12:34:56</span></li>\n<li><span title="[0-9]+ years ago">07/01/(20)?07</span></li>\n<li><span title="[0-9]+ years ago">07/01/(20)?07 12:34:56</span></li>\n</ul>\n</body>\n</html>' not found in '<!DOCTYPE html>\n<html>\n<body>\n<ul>\n<li></li>\n<li><span title="7/1/2007 12:34:56 PM">16 years ago</span></li>\n<li><span title="7/1/2007 12:34:56 PM">16 years ago</span></li>\n<li><span title="16 years ago">on 7/1/2007</span></li>\n<li><span title="16 years ago">on 7/1/2007 at 12:34:56 PM</span></li>\n<li><span title="16 years ago">7/1/2007</span></li>\n<li><span title="16 years ago">7/1/2007 12:34:56 PM</span></li>\n</ul>\n</body>\n</html>' : <!DOCTYPE html>
<html>
<body>
<ul>
<li></li>
<li><span title="7/1/2007 12:34:56 PM">16 years ago</span></li>
<li><span title="7/1/2007 12:34:56 PM">16 years ago</span></li>
<li><span title="16 years ago">on 7/1/2007</span></li>
<li><span title="16 years ago">on 7/1/2007 at 12:34:56 PM</span></li>
<li><span title="16 years ago">7/1/2007</span></li>
<li><span title="16 years ago">7/1/2007 12:34:56 PM</span></li>
</ul>
</body>
</html>
----------------------------------------------------------------------
Ran 2472 tests in 234.103s
FAILED (failures=1, skipped=9)
mingw32-make: *** [makefile:477: unit-test] Error 1
We expects 07/01/2007 12:34:56 PM but got 7/1/2007 12:34:56 PM. It seems that date formats are changed in the user session on windows-2022 image….
Attachments (0)
Change History (2)
comment:1 by , 3 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , 3 years ago
| Internal Changes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Fixed in [17687].
Note:
See TracTickets
for help on using tickets.



Ah, that's my fault. The root cause is that
locale.setlocale()is invoked fromdispatch_requestafter r17686.After confirming unit tests pass on CI, I'll push the following changes:
trac/web/tests/cgi_frontend.py
dispatch_request