Commit Graph

11 Commits

Author SHA1 Message Date
TomJGooding
7a9d32fdbf test: make tests async to fix failures on Python 3.9
After upgrading `pytest-asyncio` to the latest version, lots of tests
started failing in CI only on Python 3.9:

`RuntimeError: There is no current event loop in thread 'MainThread'`

Apparently these tests may have only been passing previously due to
issues in earlier versions of `pytest-asyncio`. Changing these tests to
async seems to fix the failures on Python 3.9.

Related issue:
https://github.com/pytest-dev/pytest-asyncio/issues/1039
2025-09-17 13:38:05 +01:00
Will McGugan
1eed935a41 markup parse and tests 2025-01-31 19:12:04 +00:00
Will McGugan
a745cda9b1 textual style 2025-01-18 17:02:39 +00:00
darrenburns
231a894941 Fixes suggested by linter (#2769) 2023-06-12 15:00:19 +01:00
Will McGugan
0509cf8948 Border style (#2292)
* border styles

* docs for border styles

* fix tests

* tests

* tests and docs

* changelog

* implement auto

* style information fix
2023-04-16 12:31:39 +01:00
Will McGugan
41af489648 title descriptors (#2213)
* title descriptors

* add extra line around titles

* changelog

* snapshots

* comment

* Fix border refresh

* simplify typing

* test for None case
2023-04-05 10:10:43 +01:00
Rodrigo Girão Serrão
c1ef3702fd Fix border rendering issue. (#2212) 2023-04-04 11:04:14 +01:00
Rodrigo Girão Serrão
2a810f8c87 Implement border (sub)title. (#2064)
* Add Widget.border_title and border_subtitle.

Related issues: #1864

* Test setting border_(sub)title.

* Add border (sub)title references to StylesCache.

These internal references will make it easier for the instance of 'StylesCache' to know which border (sub)title to use, if/when needed.

* Add method to render border label.

* Add styles to align border (sub)title.

* Render border labels.

* Update styles template.

* Make new 'render_row' parameters optional.

* Add (sub)title border snapshot tests.

* Document border (sub)title and styles.

* Pass (sub)title directly as arguments.

Get rid of the watchers to make data flow easier to follow.
Related comment: https://github.com/Textualize/textual/pull/2064/files\#r1137746697

* Tweak example.

* Fix render_border_label.

This was wrong because border labels can be composed of multiple segments if they contain multiple styles. Additionally, we want to render a single blank space of padding around the title.

* Ensure we get no label when there's no space.

* Add tests for border label rendering.

* 'render_border_label' now returns iterable of segments.

* Add label to render_row.

* Fix calling signature in tests.

* Add padding to snapshot tests.

* Fix changelog.

* Update snapshot tests.

* Update snapshot tests.

* Border labels expand if there's no corners.

* Update CHANGELOG.md

* Fix docs.

* Remove irrelevant line.

* Fix snapshot tests.

* Don't share Console among tests.

* Simplify example in styles guide.

* Avoid expensive function call when possible.

* rewording

* positive branch first

* remove wasteful indirection

* fix changelog

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-03-22 11:07:38 +00:00
Darren Burns
9287f64a66 Add isort pre-commit hook, sort imports in src and test directories 2023-02-09 13:28:08 +00:00
Darren Burns
1b0c94e8a0 Remove draw.py, fix imports 2022-10-13 11:15:15 +01:00
Will McGugan
f3a7c9483f apply style to widget 2022-07-04 14:48:28 +01:00