Commit Graph

641 Commits

Author SHA1 Message Date
darrenburns
af8af1bee9 Ensure watcher isn't called on first_set when init is False and value doesn't change (#1367)
* Ensure watcher not called when value doesnt change, even on first set

* Update CHANGELOG.md
2022-12-20 11:17:11 +00:00
Will McGugan
93716e714b Merge branch 'main' into nested-height-fix 2022-12-20 11:14:45 +00:00
Will McGugan
16994c54d1 Update tests/test_binding_inheritance.py
Co-authored-by: darrenburns <darrenburns@users.noreply.github.com>
2022-12-20 10:42:21 +00:00
Will McGugan
b265b855cd insert pause 2022-12-19 13:39:03 +00:00
Will McGugan
bb7fd40d73 force console on terminal summary 2022-12-19 13:26:47 +00:00
Will McGugan
43ed1d5927 fix snapshot 2022-12-19 13:00:42 +00:00
Will McGugan
32b7308ac8 fox for nested heights 2022-12-19 12:54:06 +00:00
Will McGugan
002cbab0d5 add pause to action 2022-12-19 11:26:42 +00:00
Will McGugan
621e96dcdd pause 2022-12-19 11:20:46 +00:00
Will McGugan
053b7f38e1 snapshot tweak 2022-12-19 10:27:29 +00:00
Will McGugan
ee59c5882e Added SkipAction exception 2022-12-19 10:01:06 +00:00
Will McGugan
af049d4a4d added test 2022-12-19 09:30:22 +00:00
Will McGugan
d11e3f2e15 Merge pull request #1346 from davep/bug/1342/inherited-movement-keys
Add support for a `PRIORITY_BINDINGS` classvar to work alongside `BINDINGS`
2022-12-16 20:13:31 +00:00
darrenburns
14a4ad48cd Merge branch 'main' into validator-first-set 2022-12-15 14:50:46 +00:00
Dave Pearson
f25f6cbbb5 Fix a typo 2022-12-15 14:45:34 +00:00
Dave Pearson
431053182c Merge branch 'main' into bug/1342/inherited-movement-keys 2022-12-15 14:28:03 +00:00
Dave Pearson
75c9fba393 Use is to test tri-state, rather than equality
See https://github.com/Textualize/textual/pull/1346#discussion_r1049675405
2022-12-15 14:26:10 +00:00
Dave Pearson
d389c9185a s/mk_/make_/g
mk_bgr
2022-12-15 14:14:25 +00:00
Dave Pearson
f08b4eda6d Swap final test to a screen type rather than instance
See https://github.com/Textualize/textual/pull/1346#discussion_r1049678092
2022-12-15 14:12:52 +00:00
Dave Pearson
7397cff52a Revert previous attempt at an experiment 2022-12-15 14:12:00 +00:00
Dave Pearson
549fd6b47e Experiment with recording at all levels
More attempts to figure out why I'm getting the async issue with messages
and the pilot.
2022-12-15 14:04:03 +00:00
Dave Pearson
b196d8cd2e Revert experimental backing out of recent changes
Didn't make a difference. CI on GitHub is still acting differently.
2022-12-15 13:29:27 +00:00
Dave Pearson
76a22d81d4 Eliminating changes
This is the one biggish change between the last working test run in GitHub,
and now. Tests are still running locally fine, an on GitHub, in the last
run, I had one job pass and another fail, both on the same OS, just 3.10
passed and 3.9 failed. The problem still to do with (as far as I can tell)
messages inside Textual and some sort of async issue.

So let's try this.
2022-12-15 13:25:05 +00:00
Dave Pearson
938cd3bd1d Namespace the recording actions
Wondering if this is the issue with why the tests have stopped working in
GitHub; but also not *really* confused as to why they were working in the
first place.
2022-12-15 13:17:16 +00:00
Dave Pearson
2f77bab409 Extra long pause test
This code is running just finally locally in tests, but is failing with:

RuntimeError: Task <Task pending name='Task-279' coro=<MessagePump._process_messages() running at /home/runner/work/textual/textual/src/textual/message_pump.py:314>> got Future <Future pending> attached to a different loop

in GitHub Actions. Pretty sure I saw this before, which made me add the
pause in the first place. Given this seems to just be affecting the last
test, from what I can tell, let's make the pause longer to see if that
helps.

I hate chasing action issues...
2022-12-15 12:57:14 +00:00
Dave Pearson
ad7c2e6c4d Round off the priority clash test and un-xfail it
Also add in a test for when there is no priority anywhere. This is still a
priority level that needs testing, it just isn't a priority.
2022-12-15 12:47:46 +00:00
Dave Pearson
618db503b9 Add tests for competing bindings an priority permutations
This is set to xfail at the moment because the tested result is what I think
should be the result, but what happens now isn't that. Need to check with
Will to see what he thinks the correct resolution is here.
2022-12-15 12:16:27 +00:00
Dave Pearson
50df082479 Keep black happy 2022-12-15 12:16:16 +00:00
Dave Pearson
8ff9af581c Test rationale comment update 2022-12-15 09:10:00 +00:00
Dave Pearson
4a78283574 Update the binding inheritance tests to reflect the emerging changes
I feel some more will be needed, but this is all of the basics, hitting all
of the important points that relate to #1343. More importantly all of the
xfails are now removed.
2022-12-14 20:59:57 +00:00
Dave Pearson
dcad134acd Add a (currently) breaking test for spaces within a key list
At the moment at least, we don't allow binding on " ", we bind on "space".
Meanwhile, tidy folk may try and bind in "a, b, c, d" as opposed to trying
to bind on "a,b,c,d". I feel we should allow for that.

This test, which breaks at the moment, should be satisfied.
2022-12-14 17:29:47 +00:00
Darren Burns
e01c33c06a Snapshot updates 2022-12-14 14:21:41 +00:00
Darren Burns
1acc36084b Add non-printable key to footer snapshot 2022-12-14 14:07:26 +00:00
Darren Burns
2b8b7c15e6 Add extra test for validator called before dom ready, update changelog 2022-12-14 12:09:00 +00:00
Darren Burns
591b692720 Call validator on first set 2022-12-14 11:28:10 +00:00
Dave Pearson
d9e73b82f5 Be less explicit about checking for movement keys, check for any keys
See https://github.com/Textualize/textual/pull/1346#discussion_r1048330186
2022-12-14 11:12:46 +00:00
Dave Pearson
d353188c24 Correct a typo 2022-12-14 10:59:17 +00:00
Dave Pearson
5859437040 Run black over the tests 2022-12-14 10:58:09 +00:00
Dave Pearson
ca9c3b43dd Add the likely "final boss" test for the binding issue 2022-12-13 21:58:09 +00:00
Dave Pearson
87e18de605 Move the assert on key records into all_recorded
While what I had worked, asserting on a boolean return from that method
ended up masking what had gone wrong. This way we get to see the fail
and *why* it failed.
2022-12-13 21:56:43 +00:00
Dave Pearson
5330d2a425 DRY the checking of the recorded keystrokes 2022-12-13 18:40:00 +00:00
Dave Pearson
c6981964a7 Fix a typo 2022-12-13 18:23:44 +00:00
Dave Pearson
c68dae6ad7 Try and coax older Pythons into being happy with list[...]
I think?
2022-12-13 18:19:20 +00:00
Dave Pearson
cdca7dc2dd Revamp the binding inheritance unit tests
The tests are getting a little involved, and aim to tell an important story
about how the binding inheritance works, currently causes problems, and
should eventually work. As such I feel it's time to tidy things up a bit,
reduce some of the copy/paste going on, and comment heavily so I don't lose
my place and thinking, not to mention hopefully help someone else reading
make sense of the tests.
2022-12-13 18:10:40 +00:00
Dave Pearson
3f225469a5 Remove xfail on non-inherit-no-BINDINGS test
This now is fine thanks to #1352 fixing #1351.
2022-12-13 16:59:05 +00:00
Dave Pearson
1158bff4d2 Merge branch 'main' into bug/1342/inherited-movement-keys 2022-12-13 16:56:34 +00:00
Rodrigo Girão Serrão
f5dbdc9ee1 Merge branch 'main' into fix-1351 2022-12-13 16:18:39 +00:00
Rodrigo Girão Serrão
6d480056e5 Add a test for binding merging. 2022-12-13 16:15:28 +00:00
Rodrigo Girão Serrão
d49477ce5a Merge pull request #1336 from Textualize/fix-1335
Fix default CSS retrieval from widgets with no `DEFAULT_CSS` that inherit from widgets that do have `DEFAULT_CSS`
2022-12-13 15:43:07 +00:00
Dave Pearson
e8c87ced33 Add test for focused widget, no inherit, empty BINDINGS
Testing the overlap between #1343 and #1351.
2022-12-13 15:29:13 +00:00