mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add clarifications.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/* This file is purposefully empty. */
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ from textual.widgets import Label
|
|||||||
|
|
||||||
CSS_PATH = (Path(__file__) / "../hot_reloading_app.css").resolve()
|
CSS_PATH = (Path(__file__) / "../hot_reloading_app.css").resolve()
|
||||||
|
|
||||||
|
# Write some CSS to the file before the app loads.
|
||||||
|
# Then, the test will clear all the CSS to see if the
|
||||||
|
# hot reloading applies the changes correctly.
|
||||||
CSS_PATH.write_text(
|
CSS_PATH.write_text(
|
||||||
"""
|
"""
|
||||||
Container {
|
Container {
|
||||||
|
|||||||
@@ -343,10 +343,12 @@ def test_scrollbar_thumb_height(snap_compare):
|
|||||||
|
|
||||||
|
|
||||||
def test_css_hot_reloading(snap_compare):
|
def test_css_hot_reloading(snap_compare):
|
||||||
|
"""Regression test for https://github.com/Textualize/textual/issues/2063."""
|
||||||
|
|
||||||
async def run_before(pilot):
|
async def run_before(pilot):
|
||||||
css_file = pilot.app.CSS_PATH
|
css_file = pilot.app.CSS_PATH
|
||||||
with open(css_file, "w") as f:
|
with open(css_file, "w") as f:
|
||||||
f.write("") # Clear all the CSS.
|
f.write("/* This file is purposefully empty. */\n") # Clear all the CSS.
|
||||||
await pilot.app._on_css_change()
|
await pilot.app._on_css_change()
|
||||||
|
|
||||||
assert snap_compare(
|
assert snap_compare(
|
||||||
|
|||||||
Reference in New Issue
Block a user