[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Nov 7 14:25:10 PST 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/9423fbdc1ca7/
changeset: 9423fbdc1ca7
branch: yt
user: MatthewTurk
date: 2012-11-07 23:06:32
summary: Adding a prefix for result storage
affected #: 1 file
diff -r 52d3a540a8cf363189cd075d4cae16ab311bcec7 -r 9423fbdc1ca7bcc023a66b68fd912a852c6427ff yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -162,19 +162,24 @@
class AnswerTestingTest(object):
reference_storage = None
+ prefix = ""
def __init__(self, pf_fn):
self.pf = data_dir_load(pf_fn)
def __call__(self):
nv = self.run()
if self.reference_storage is not None:
- dd = self.reference_storage.get(str(self.pf))
+ dd = self.reference_storage.get(self.storage_name)
if dd is None: raise YTNoOldAnswer()
ov = dd[self.description]
self.compare(nv, ov)
else:
ov = None
- self.result_storage[str(self.pf)][self.description] = nv
+ self.result_storage[self.storage_name][self.description] = nv
+
+ @property
+ def storage_name(self):
+ return "%s_%s" % (self.prefix, self.pf)
def compare(self, new_result, old_result):
raise RuntimeError
@@ -383,11 +388,16 @@
for newc, oldc in zip(new_result["children"], old_result["children"]):
assert(newp == oldp)
-def requires_outputlog(path = "."):
+def requires_outputlog(path = ".", prefix = ""):
def ffalse(func):
return lambda: None
def ftrue(func):
- return func
+ def fyielder(*args, **kwargs):
+ for t in func(*args, **kwargs):
+ if isinstance(t, AnswerTestingTest):
+ t.prefix = prefix
+ yield t
+ return fyielder
if os.path.exists("OutputLog"):
return ftrue
with temp_cwd(path):
https://bitbucket.org/yt_analysis/yt/changeset/350b37e4bf20/
changeset: 350b37e4bf20
branch: yt
user: brittonsmith
date: 2012-11-07 23:24:05
summary: Matt fixing bug.
affected #: 1 file
diff -r 9423fbdc1ca7bcc023a66b68fd912a852c6427ff -r 350b37e4bf205ccf97496c5563119bbcf36fe3a3 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -392,6 +392,7 @@
def ffalse(func):
return lambda: None
def ftrue(func):
+ @wraps(func)
def fyielder(*args, **kwargs):
for t in func(*args, **kwargs):
if isinstance(t, AnswerTestingTest):
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list