Mercurial > kallithea
changeset 6650:e62b86858683
tests: move time zone setup to pytest_configure
Test setup stuff belongs in pytest_configure.
author | domruf <dominikruf@gmail.com> |
---|---|
date | Wed, 10 May 2017 23:14:12 +0200 |
parents | a9b169709aea |
children | 986efdcfaf64 |
files | kallithea/tests/base.py kallithea/tests/conftest.py |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/base.py Wed May 10 22:50:19 2017 +0200 +++ b/kallithea/tests/base.py Wed May 10 23:14:12 2017 +0200 @@ -23,14 +23,11 @@ from tg import config from webtest import TestApp -from kallithea import is_windows, model +from kallithea import model from kallithea.model.db import Notification, User, UserNotification from kallithea.model.meta import Session from kallithea.lib.utils2 import safe_str -os.environ['TZ'] = 'UTC' -if not is_windows: - time.tzset() log = logging.getLogger(__name__)
--- a/kallithea/tests/conftest.py Wed May 10 22:50:19 2017 +0200 +++ b/kallithea/tests/conftest.py Wed May 10 23:14:12 2017 +0200 @@ -2,6 +2,7 @@ import sys import logging import pkg_resources +import time from paste.deploy import loadwsgi from routes.util import URLGenerator @@ -21,6 +22,10 @@ from tg.util.webtest import test_context def pytest_configure(): + os.environ['TZ'] = 'UTC' + if not kallithea.is_windows: + time.tzset() + path = os.getcwd() sys.path.insert(0, path) pkg_resources.working_set.add_entry(path)