[New-bugs-announce] [issue10213] tests shouldn't fail with unset timezone

Dirkjan Ochtman report at bugs.python.org
Wed Oct 27 13:51:26 CEST 2010

New submission from Dirkjan Ochtman <dirkjan at ochtman.nl>:

test_strptime in test_time fails when the timezone is not set:

FAIL: test_strptime (test.test_time.TimeTestCase)
Traceback (most recent call last):
line 117, in test_strptime
    (format, strf_output))
AssertionError: conversion specifier '%Z' failed with 'Local time zone must be set--see zic manual page' input.

Ran 14 tests in 1.206s
Maybe something like this is good enough?

Index: test_time.py
--- test_time.py        (revision 85856)
+++ test_time.py        (working copy)
@@ -111,6 +111,8 @@
                 time.strptime(strf_output, format)
             except ValueError:
+                if 'Local time zone must be set' in strf_output:
+                    continue
                 self.fail("conversion specifier %r failed with '%s' input." %
                           (format, strf_output))

components: Tests
messages: 119696
nosy: belopolsky, djc
priority: normal
severity: normal
status: open
title: tests shouldn't fail with unset timezone
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list