class_docstr: Tests the ColorPalette object
docstr: Test ColorPalette context management
docstr_tok: ["Test","ColorPalette","context","management"]
code: def test_color_palette_context(self):
      """
      Test ColorPalette context management
      """
      default = color_palette()
      context = color_palette("dark")
  
      with ColorPalette("dark") as palette:
          assert isinstance(palette, ColorPalette)
          assert get_color_cycle() == context
  
      assert get_color_cycle() == default
  
imports: import pytest
  import numpy
  import matplotlib
  from yellowbrick.exceptions import *
  from yellowbrick.style.palettes import *
  from yellowbrick.style.colors import get_color_cycle
  from yellowbrick.style.rcmod import set_aesthetic, set_palette
  from yellowbrick.style.palettes import color_sequence, color_palette
  from yellowbrick.style.palettes import ColorPalette, PALETTES, SEQUENCES
  from tests.base import VisualTestCase
label_desc: Use image node_id 3 for calling the TestColorPaletteObject obj's underlying member method code with example usage: obj.test_color_palette_context() without return types