]> gitweb.michael.orlitzky.com - djbdns-logparse.git/commitdiff
djbdns/io.py: fix test that fails in other timezones.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 23 Sep 2022 12:04:34 +0000 (08:04 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 23 Sep 2022 12:04:34 +0000 (08:04 -0400)
djbdns/io.py

index a3e6e430e8a7e7a19890b7d94af36eff3e42b86d..c3952bed7da220119a68604e2ed6d0f26d098114 100644 (file)
@@ -24,6 +24,8 @@ def parse_logfile(file : TextIO):
         >>> from tempfile import NamedTemporaryFile
         >>> with NamedTemporaryFile(mode="w", delete=False) as f:
         ...     _ = f.write(line)
+        >>> from os import environ
+        >>> environ["TZ"] = "UTC+4"
         >>> f = open(f.name, 'r')
         >>> parse_logfile(f)
         2022-09-14 21:04:40.206516500 dropped query (no authority) from 127.0.0.1:40289 (id 48745): a www.example.com