[apycotlib] keep a reference on the options dict in ATest
authorDavid Douard <david.douard@logilab.fr>
Wed, 14 May 2014 16:05:06 +0200
changeset 1518 fd0a087f6117
parent 1517 b7c29a8b16ec
child 1519 2a8d6cfd864b
[apycotlib] keep a reference on the options dict in ATest So it can be easily used from recipes
_apycotlib/atest.py
--- a/_apycotlib/atest.py	Wed May 14 15:07:42 2014 +0200
+++ b/_apycotlib/atest.py	Wed May 14 16:05:06 2014 +0200
@@ -57,7 +57,7 @@
             sys.path.insert(0, clean_path(path))
 
 
-from narvalbot.engine import options_dict
+from narvalbot import options_dict
 
 class Test(object):
     """the single source unit test class"""
@@ -94,6 +94,7 @@
         self._failed_pp = set()
         self.executed_checkers = {}
         self.global_status = SUCCESS
+        self.options = options
         os.umask(022)
 
     def __str__(self):
@@ -268,7 +269,7 @@
 
     def run_checker(self, id, displayname=None, nonexecuted=False, **kwargs):
         """run all checks in the test environment"""
-        options = options_dict(self.texec['options'])
+        options = self.options.copy()
         options.update(kwargs)
         self._substitute(self.environment, options)
         check_writer = self.writer.make_check_writer()