equal
deleted
inserted
replaced
22 __docformat__ = "restructuredtext en" |
22 __docformat__ = "restructuredtext en" |
23 |
23 |
24 import os |
24 import os |
25 import sys |
25 import sys |
26 import re |
26 import re |
|
27 import urlparse |
|
28 from os.path import dirname |
27 from urllib import unquote |
29 from urllib import unquote |
28 import urlparse |
|
29 from math import log |
30 from math import log |
30 from contextlib import contextmanager |
31 from contextlib import contextmanager |
31 from warnings import warn |
32 from warnings import warn |
32 |
33 |
33 import yams.schema |
34 import yams.schema |
196 Configuration is cached on the test class. |
197 Configuration is cached on the test class. |
197 """ |
198 """ |
198 try: |
199 try: |
199 return cls.__dict__['_config'] |
200 return cls.__dict__['_config'] |
200 except KeyError: |
201 except KeyError: |
201 config = cls._config = cls.configcls(cls.appid) |
202 home = join(dirname(sys.modules[self.__class__.__module__].__file__), |
|
203 cls.appid) |
|
204 config = cls._config = cls.configcls(cls.appid, apphome=home) |
202 config.mode = 'test' |
205 config.mode = 'test' |
203 return config |
206 return config |
204 |
207 |
205 @classmethod |
208 @classmethod |
206 def init_config(cls, config): |
209 def init_config(cls, config): |