Skip to content

Commit

Permalink
Merge branch 'feat/screenshots-only-opt' of https://github.com/pyvist…
Browse files Browse the repository at this point in the history
…a/pyvista into feat/screenshots-only-opt

# Conflicts:
#	tests/plotting/test_plotter.py
  • Loading branch information
AlejandroFernandezLuces committed Nov 17, 2023
2 parents 4207d79 + 4e0f5e8 commit 005fb25
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/plotting/test_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,19 +468,17 @@ def test_plotter_update_coordinates(sphere):
raise RuntimeError("Remove this method")


def test_only_screenshots_flag(sphere, tmpdir):
tmpscreenshots = pv.ON_SCREENSHOT
tmpfigurepath = pv.FIGURE_PATH

def test_only_screenshots_flag(sphere, tmpdir, global_variables_reset):
pv.FIGURE_PATH = str(tmpdir)

pv.ON_SCREENSHOT = True

entries = os.listdir(pv.FIGURE_PATH)
pl = pv.Plotter()
pl.add_mesh(sphere)
pl.show()
entries_after = os.listdir(pv.FIGURE_PATH)
assert len(entries) == len(entries_after) - 1
assert len(entries) + 1 == len(entries_after)

res_file = list(set(entries_after) - set(entries))[0]
pv.ON_SCREENSHOT = False
sphere_screenshot = "sphere_screenshot.png"
Expand All @@ -491,5 +489,3 @@ def test_only_screenshots_flag(sphere, tmpdir):
res_path = os.path.join(pv.FIGURE_PATH, res_file)
error = pv.compare_images(sphere_path, res_path)
assert error < 100
pv.ON_SCREENSHOT = tmpscreenshots
pv.FIGURE_PATH = tmpfigurepath

0 comments on commit 005fb25

Please sign in to comment.