8000 TST: force test with shared test image to run in serial · matplotlib/matplotlib@8ade798 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ade798

Browse files
committed
TST: force test with shared test image to run in serial
The tests test_hexbin_empty and test_hexbin_log_empty use the same target image, however if they the tests ended up being run in different workers when running the tests in parallel they will step on each other if one of the test starts writing the output file while the other is trying to read the test image. By putting them in the same test they will save and evaluate in order.
1 parent 7de767e commit 8ade798

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -894,18 +894,14 @@ def test_hexbin_extent():
894894
ax.hexbin("x", "y", extent=[.1, .3, .6, .7], data=data)
895895

896896

897-
@image_comparison(['hexbin_empty.png'], remove_text=True)
897+
@image_comparison(['hexbin_empty.png', 'hexbin_empty.png'], remove_text=True)
898898
def test_hexbin_empty():
899899
# From #3886: creating hexbin from empty dataset raises ValueError
900-
ax = plt.gca()
900+
fig, ax = plt.subplots()
901901
ax.hexbin([], [])
902-
903-
904-
@image_comparison(['hexbin_empty.png'], remove_text=True)
905-
def test_hexbin_log_empty():
902+
fig, ax = plt.subplots()
906903
# From #23922: creating hexbin with log scaling from empty
907904
# dataset raises ValueError
908-
ax = plt.gca()
909905
ax.hexbin([], [], bins='log')
910906

911907

0 commit comments

Comments
 (0)
0