From e50e00cee9578e03a42b31497d97807143e86bcc Mon Sep 17 00:00:00 2001 From: wesleybl Date: Fri, 23 Feb 2024 11:32:20 -0300 Subject: [PATCH] Uses TZ = UTC in buildout This ensures that tests using datetime will work locally on machines using TZ = GMT --- tests.cfg | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests.cfg b/tests.cfg index 05c552f9de..9cb9373fb4 100644 --- a/tests.cfg +++ b/tests.cfg @@ -126,6 +126,15 @@ recipe = collective.xmltestreport eggs = ${buildout:test-eggs} defaults = ['--auto-color', '--auto-progress', '--ignore_dir=.git', '--ignore_dir=bower_components', '--ignore_dir=node_modules'] environment = environment +initialization = +# Ensures that tests using datetime will work locally on machines using TZ = GMT + os.environ['TZ'] = 'UTC' + import time + try: + time.tzset() + except AttributeError: + # function not available on Windows + pass [robot] recipe = zc.recipe.egg