mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-04 17:22:39 +02:00
[testing] testing the error messages for plotting
This commit is contained in:
parent
065ab725ff
commit
3c618c1525
2 changed files with 16 additions and 9 deletions
|
|
@ -28,6 +28,7 @@
|
|||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#===============================================================================
|
||||
import matplotlib
|
||||
from unittest.case import TestCase
|
||||
matplotlib.use('agg')
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -35,13 +36,21 @@ import GPy, os
|
|||
from nose import SkipTest
|
||||
|
||||
from ..util.config import config
|
||||
from ..plotting import change_plotting_library
|
||||
from ..plotting import change_plotting_library, plotting_library
|
||||
|
||||
class ConfigTest(TestCase):
|
||||
def tearDown(self):
|
||||
change_plotting_library('matplotlib')
|
||||
|
||||
def test_change_plotting(self):
|
||||
self.assertRaises(ValueError, change_plotting_library, 'not+in9names')
|
||||
change_plotting_library('none')
|
||||
self.assertRaises(RuntimeError, plotting_library)
|
||||
|
||||
change_plotting_library('matplotlib')
|
||||
if config.get('plotting', 'library') != 'matplotlib':
|
||||
raise SkipTest("Matplotlib not installed, not testing plots")
|
||||
|
||||
|
||||
try:
|
||||
from matplotlib import cbook, pyplot as plt
|
||||
from matplotlib.testing.compare import compare_images
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue