File: test_code_highlight.py

package info (click to toggle)
superqt 0.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,320 kB
  • sloc: python: 9,108; makefile: 16; sh: 12
file content (19 lines) | stat: -rw-r--r-- 644 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from qtpy.QtWidgets import QTextEdit

from superqt.utils import CodeSyntaxHighlight


def test_code_highlight(qtbot):
    widget = QTextEdit()
    qtbot.addWidget(widget)
    code_highlight = CodeSyntaxHighlight(widget, "python", "default")
    assert code_highlight.background_color == "#f8f8f8"
    widget.setText("from argparse import ArgumentParser")


def test_code_highlight_by_name(qtbot):
    widget = QTextEdit()
    qtbot.addWidget(widget)
    code_highlight = CodeSyntaxHighlight(widget, "Python Traceback", "monokai")
    assert code_highlight.background_color == "#272822"
    widget.setText("from argparse import ArgumentParser")