Skip to content

Minor cleanups for tests. #8846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/matplotlib/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_contains():

# draw the text. This is important, as the contains method can only work
# when a renderer exists.
plt.draw()
fig.canvas.draw()

for x, y in zip(xs.flat, ys.flat):
mevent.x, mevent.y = plt.gca().transAxes.transform_point([x, y])
Expand Down Expand Up @@ -238,12 +238,12 @@ def test_set_position():
# test set_position
ann = ax.annotate(
'test', (0, 0), xytext=(0, 0), textcoords='figure pixels')
plt.draw()
fig.canvas.draw()

init_pos = ann.get_window_extent(fig.canvas.renderer)
shift_val = 15
ann.set_position((shift_val, shift_val))
plt.draw()
fig.canvas.draw()
post_pos = ann.get_window_extent(fig.canvas.renderer)

for a, b in zip(init_pos.min, post_pos.min):
Expand All @@ -252,12 +252,12 @@ def test_set_position():
# test xyann
ann = ax.annotate(
'test', (0, 0), xytext=(0, 0), textcoords='figure pixels')
plt.draw()
fig.canvas.draw()

init_pos = ann.get_window_extent(fig.canvas.renderer)
shift_val = 15
ann.xyann = (shift_val, shift_val)
plt.draw()
fig.canvas.draw()
post_pos = ann.get_window_extent(fig.canvas.renderer)

for a, b in zip(init_pos.min, post_pos.min):
Expand Down Expand Up @@ -396,7 +396,6 @@ def test_agg_text_clip():
for x, y in np.random.rand(10, 2):
ax1.text(x, y, "foo", clip_on=True)
ax2.text(x, y, "foo")
plt.show()


def test_text_size_binding():
Expand Down
4 changes: 2 additions & 2 deletions tools/triage_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, parent, index, name):
self.image = QtWidgets.QLabel()
self.image.setAlignment(QtCore.Qt.AlignHCenter |
QtCore.Qt.AlignVCenter)
self.image.setMinimumSize(800/3, 600/3)
self.image.setMinimumSize(800/3, 500/3)
layout.addWidget(self.image)
self.setLayout(layout)

Expand Down Expand Up @@ -139,7 +139,7 @@ def __init__(self, entries):
self.image_display = QtWidgets.QLabel()
self.image_display.setAlignment(QtCore.Qt.AlignHCenter |
QtCore.Qt.AlignVCenter)
self.image_display.setMinimumSize(800, 600)
self.image_display.setMinimumSize(800, 500)
images_layout.addWidget(thumbnails_box, 3)
images_layout.addWidget(self.image_display, 6)
images_box.setLayout(images_layout)
Expand Down