Fix tests.

This commit is contained in:
Rodrigo Girão Serrão
2023-05-18 16:26:24 +01:00
parent c85e428228
commit 6523fbaff1
4 changed files with 73 additions and 69 deletions

View File

@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `Placeholder` now sets its color cycle per app https://github.com/Textualize/textual/issues/2590
### Removed
- `Placeholder.reset_color_cycle`
## [0.25.0] - 2023-05-17
### Changed

View File

@@ -1,6 +1,6 @@
from textual.app import App
from textual.containers import Horizontal
from textual.widgets import Placeholder, Label, Static
from textual.widgets import Label, Placeholder, Static
class Ruler(Static):
@@ -9,7 +9,7 @@ class Ruler(Static):
yield Label(ruler_text)
class HeightComparisonApp(App):
class WidthComparisonApp(App):
def compose(self):
yield Horizontal(
Placeholder(id="cells"), # (1)!
@@ -25,4 +25,6 @@ class HeightComparisonApp(App):
yield Ruler()
app = HeightComparisonApp(css_path="width_comparison.css")
app = WidthComparisonApp(css_path="width_comparison.css")
if __name__ == "__main__":
app.run()

File diff suppressed because one or more lines are too long

View File

@@ -91,7 +91,6 @@ def test_buttons_render(snap_compare):
def test_placeholder_render(snap_compare):
# Testing the rendering of the multiple placeholder variants and labels.
Placeholder.reset_color_cycle()
assert snap_compare(WIDGET_EXAMPLES_DIR / "placeholder.py")
@@ -261,7 +260,6 @@ PATHS = [
@pytest.mark.parametrize("file_name", PATHS)
def test_css_property(file_name, snap_compare):
path_to_app = STYLES_EXAMPLES_DIR / file_name
Placeholder.reset_color_cycle()
assert snap_compare(path_to_app)