From f6c62ec2bb256e5f5332f2304d77609bf80931eb Mon Sep 17 00:00:00 2001 From: wesleybl Date: Fri, 23 Feb 2024 11:45:13 -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 b5a59b59bc..fb83dc28a7 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