test_gridspec.py 626 B

1234567891011121314151617181920212223242526
  1. import matplotlib.gridspec as gridspec
  2. import pytest
  3. def test_equal():
  4. gs = gridspec.GridSpec(2, 1)
  5. assert gs[0, 0] == gs[0, 0]
  6. assert gs[:, 0] == gs[:, 0]
  7. def test_width_ratios():
  8. """
  9. Addresses issue #5835.
  10. See at https://github.com/matplotlib/matplotlib/issues/5835.
  11. """
  12. with pytest.raises(ValueError):
  13. gridspec.GridSpec(1, 1, width_ratios=[2, 1, 3])
  14. def test_height_ratios():
  15. """
  16. Addresses issue #5835.
  17. See at https://github.com/matplotlib/matplotlib/issues/5835.
  18. """
  19. with pytest.raises(ValueError):
  20. gridspec.GridSpec(1, 1, height_ratios=[2, 1, 3])