    def test_list_box_color_options(self):
        """
        Check setting listbox options with inline colors works as expected.
        """
        # Create a dummy screen.
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=True)
        canvas = Canvas(screen, 10, 40, 0, 0)

        # Create the form we want to test.
        form = Frame(canvas, canvas.height, canvas.width, has_border=False, can_scroll=False)
        layout = Layout([100], fill_frame=True)
        form.add_layout(layout)
        listbox = ListBox(2, [], parser=AsciimaticsParser())
        options = [("P", 1), ("${9,2}Q", 2), ("R", 3), ("${10,3}S", 4)]
        listbox.options = options
        layout.add_widget(listbox)

        color_options = listbox.options
        self.assertIsInstance(color_options[0][0], ColouredText)
        self.assertEqual(color_options[0][0].raw_text, options[0][0])

        self.assertIsInstance(color_options[1][0], ColouredText)
        self.assertEqual(color_options[1][0].raw_text, options[1][0])

        self.assertIsInstance(color_options[2][0], ColouredText)
        self.assertEqual(color_options[2][0].raw_text, options[2][0])

        self.assertIsInstance(color_options[3][0], ColouredText)
        self.assertEqual(color_options[3][0].raw_text, options[3][0])
Check setting listbox options with inline colors works as expected.
tests/test_widgets.py