From 3b19a50924721316cc7e85942c241899d5b99f03 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Oct 11 2017 15:28:20 +0000 Subject: set timezone to US/Eastern when test_build_notification executing following PR#628 --- diff --git a/tests/test_builder/test_build_notification.py b/tests/test_builder/test_build_notification.py index 8f3e4a5..6ba4d95 100644 --- a/tests/test_builder/test_build_notification.py +++ b/tests/test_builder/test_build_notification.py @@ -51,6 +51,8 @@ class MyClientSession(koji.ClientSession): class TestBuildNotification(unittest.TestCase): def setUp(self): + self.original_timezone = os.environ.get('TZ') + os.environ['TZ'] = 'US/Eastern' self.tempdir = tempfile.mkdtemp() self.SMTP = mock.patch('smtplib.SMTP').start() self.session = mock.MagicMock() @@ -59,6 +61,10 @@ class TestBuildNotification(unittest.TestCase): self.options.workdir = self.tempdir def tearDown(self): + if self.original_timezone is None: + del os.environ['TZ'] + else: + os.environ['TZ'] = self.original_timezone mock.patch.stopall() def test_build_notification(self):