[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Nov 21 17:21:31 PST 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/9784180f48b2/
changeset: 9784180f48b2
branch: yt
user: ngoldbaum
date: 2012-11-22 00:32:37
summary: Adding a barebones set of tests for PlotWindow plots.
affected #: 1 file
diff -r 1ea61855c847d65670ceb8354c2803d891ecf400 -r 9784180f48b2d7415dce61848d934fb69395fbbd yt/visualization/tests/test_plotwindow.py
--- /dev/null
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -0,0 +1,26 @@
+from yt.testing import *
+from yt.mods import SlicePlot, ProjectionPlot, \
+ OffAxisSlicePlot, OffAxisProjectionPlot
+import glob, os
+
+def setup():
+ from yt.config import ytcfg
+ ytcfg["yt","__withintesting"] = "True"
+
+def teardown_func():
+ fns = glob.glob("*.png")
+ for fn in fns:
+ os.remove(fn)
+
+def test_plotwindow():
+ pf = fake_random_pf(64)
+ for dim in [0,1,2]:
+ slc = SlicePlot(pf, dim, 'Density')
+ prj = ProjectionPlot(pf, dim, 'Density')
+ slc.save()
+ prj.save()
+ normal = [1,1,1]
+ oaslc = OffAxisSlicePlot(pf, normal, 'Density')
+ oaprj = OffAxisProjectionPlot(pf, normal, 'Density')
+ teardown_func()
+
https://bitbucket.org/yt_analysis/yt/changeset/87237e244a95/
changeset: 87237e244a95
branch: yt
user: ngoldbaum
date: 2012-11-22 02:12:32
summary: Only removing files created by the plotwindow tests.
affected #: 1 file
diff -r 9784180f48b2d7415dce61848d934fb69395fbbd -r 87237e244a95b890c143ade79b97284739bf148a yt/visualization/tests/test_plotwindow.py
--- a/yt/visualization/tests/test_plotwindow.py
+++ b/yt/visualization/tests/test_plotwindow.py
@@ -7,20 +7,22 @@
from yt.config import ytcfg
ytcfg["yt","__withintesting"] = "True"
-def teardown_func():
- fns = glob.glob("*.png")
+def teardown_func(fns):
for fn in fns:
os.remove(fn)
def test_plotwindow():
pf = fake_random_pf(64)
+ fns = []
for dim in [0,1,2]:
slc = SlicePlot(pf, dim, 'Density')
+ fns.append(slc.save()[0])
prj = ProjectionPlot(pf, dim, 'Density')
- slc.save()
- prj.save()
+ fns.append(prj.save()[0])
normal = [1,1,1]
oaslc = OffAxisSlicePlot(pf, normal, 'Density')
+ fns.append(oaslc.save()[0])
oaprj = OffAxisProjectionPlot(pf, normal, 'Density')
- teardown_func()
+ fns.append(oaprj.save()[0])
+ teardown_func(fns)
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