Add clarifications.

This commit is contained in:
Rodrigo Girão Serrão
2023-03-28 15:07:39 +01:00
parent 3a6967341c
commit b9c6aec2e6
3 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1 @@
/* This file is purposefully empty. */

View File

@@ -7,6 +7,9 @@ from textual.widgets import Label
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(
"""
Container {

View File

@@ -343,10 +343,12 @@ def test_scrollbar_thumb_height(snap_compare):
def test_css_hot_reloading(snap_compare):
"""Regression test for https://github.com/Textualize/textual/issues/2063."""
async def run_before(pilot):
css_file = pilot.app.CSS_PATH
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()
assert snap_compare(