changeset 2254:8b1a79ad7a42 beta

fix windows test issue with tzset()
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 10 May 2012 19:52:11 +0200
parents ce6b295f74ad
children 95800dad44d0
files rhodecode/__init__.py rhodecode/tests/__init__.py
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/__init__.py	Wed May 09 21:19:25 2012 +0200
+++ b/rhodecode/__init__.py	Thu May 10 19:52:11 2012 +0200
@@ -46,6 +46,9 @@
 PLATFORM_WIN = ('Windows')
 PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD', 'OpenBSD', 'SunOS')
 
+is_windows = __platform__ in PLATFORM_WIN
+is_unix = __platform__ in PLATFORM_OTHERS
+
 requirements = [
     "Pylons==1.0.0",
     "Beaker==1.6.3",
@@ -68,7 +71,7 @@
     requirements.append("simplejson")
     requirements.append("pysqlite")
 
-if __platform__ in PLATFORM_WIN:
+if is_windows:
     requirements.append("mercurial>=2.2.1,<2.3")
 else:
     requirements.append("py-bcrypt")
--- a/rhodecode/tests/__init__.py	Wed May 09 21:19:25 2012 +0200
+++ b/rhodecode/tests/__init__.py	Thu May 10 19:52:11 2012 +0200
@@ -21,13 +21,15 @@
 from routes.util import URLGenerator
 from webtest import TestApp
 
+from rhodecode import is_windows
 from rhodecode.model.meta import Session
 from rhodecode.model.db import User
 
 import pylons.test
 
 os.environ['TZ'] = 'UTC'
-time.tzset()
+if not is_windows:
+    time.tzset()
 
 log = logging.getLogger(__name__)
 
@@ -71,6 +73,7 @@
 HG_FORK = 'vcs_test_hg_fork'
 GIT_FORK = 'vcs_test_git_fork'
 
+
 class TestController(TestCase):
 
     def __init__(self, *args, **kwargs):