test_output_window
Hosted unit tests for the output window API.
Run from Revit via the DevTools "Output Window Tests" button (zero-doc context) or the "Run All Tests" aggregator. The tests exercise window metadata, buffered printing, progress bar control, and chart factory methods without requiring a document.
Visual correctness (styling, ordering, emoji rendering) is covered by the print-based regression buttons under Log Output Tests and by the "Test Output Stream" button; this suite only asserts programmatic behavior.
Classes
OutputWindowMetadataTests
Bases: TestCase
Window identity, title, size, and debug-mode handling.
Methods:
setUp()
test_output_is_singleton()
Repeated get_output calls return the same output window.
test_output_uniqueid()
test_title_round_trip()
A stored title is retrievable via get_title.
test_width_round_trip()
A stored width is retrievable as a positive number.
Hosts may adjust the requested width (DPI scaling, window chrome), so only the numeric round trip is asserted.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
test_debug_mode_round_trip()
Debug mode toggles are reflected by the getter.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
test_get_head_html_returns_string()
test_is_closed_by_user_returns_bool()
OutputWindowPrintTests
Bases: TestCase
Buffered printing methods complete without error.
Methods:
setUp()
test_print_md()
test_print_html()
test_print_code()
test_print_table()
Tabular data printing accepts columns and formats.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
test_insert_divider()
test_linkify_returns_html_str()
Linkified element ids render as clickable html anchors.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
OutputWindowProgressTests
Bases: TestCase
Progress bar control methods complete without error.
Methods:
setUp()
test_update_progress()
test_indeterminate_progress()
Indeterminate progress state toggles without error.
test_hide_unhide_reset_progress()
Hide/unhide/reset progress cycle without error.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
OutputWindowLogPanelTests
Bases: TestCase
Log panel and styled log record methods complete without error.
Methods:
setUp()
test_show_hide_logpanel()
test_log_levels()
All styled log record levels render without error.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
OutputWindowChartFactoryTests
Bases: TestCase
Chart factory methods produce configurable chart objects.
Methods:
setUp()
test_make_chart()
Generic charts expose data, options, and draw.
Source code in pyrevitlib/pyrevit/unittests/test_output_window.py
test_make_line_chart()
Line charts are created with the line chart type.