Beispiel #1
0
    def test_style_context_manager(self):

        yb_rcmod.set_style("darkgrid")
        orig_params = yb_rcmod._axes_style()
        context_params = yb_rcmod._axes_style("whitegrid")

        with yb_rcmod._axes_style("whitegrid"):
            self.assert_rc_params(context_params)
        self.assert_rc_params(orig_params)

        @yb_rcmod._axes_style("whitegrid")
        def func():
            self.assert_rc_params(context_params)

        func()
        self.assert_rc_params(orig_params)
Beispiel #2
0
 def test_set_style(self):
     """
     Test setting the yellowbrick axes style
     """
     style_dict = yb_rcmod._axes_style()
     yb_rcmod.set_style()
     self.assert_rc_params(style_dict)
Beispiel #3
0
    def test_rc_override(self):
        """
        Test being able to override the rc params
        """

        rc = {"axes.facecolor": "blue", "foo.notaparam": "bar"}
        out = yb_rcmod._axes_style("darkgrid", rc)
        assert out["axes.facecolor"] == "blue"
        assert "foo.notaparam" not in out
    def test_rc_override(self):
        """
        Test being able to override the rc params
        """

        rc = {"axes.facecolor": "blue", "foo.notaparam": "bar"}
        out = yb_rcmod._axes_style("darkgrid", rc)
        self.assertEqual(out["axes.facecolor"], "blue")
        self.assertNotIn("foo.notaparam", out)
Beispiel #5
0
 def test_default_return(self):
     """
     Test that the axes style returns the default params
     """
     current = yb_rcmod._axes_style()
     self.assert_rc_params(current)