-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snap_compare failures using DirectoryTree
s and .mount
in spite of identical appearance
#5073
Comments
We found the following entries in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review. This is an automated reply, generated by FAQtory |
.mount
in spite of identical appearanceDirectoryTree
s and .mount
in spite of identical appearance
Correction: # This works
# def compose(self):
# yield DirectoryTree(ROOT)
# yield DirectoryTree(ROOT) Not entirely. Using the code quoted above instead of the
|
Snapshots may fail when you update Textual. This can happen when we change something. More often than not there is no visual change to the output, and you can just accept the changes. If you always get the same output for a particular version of Textual, then that indicates there is no problem -- assuming the output is what you expected. If you are getting different output which the same version of Textual, then that most often indicates that the output is being generated differently run-to-run. From your code I can see you aren't awaiting the mounts or the reload. If you don't await them, they will run at the same time, likely introducing a race condition. Your sample.py is not using our test framework. Which makes this less predictable. I would suggest testing via a pytest test. If you don't see issues after awaiting the tree operations, then that may be the fix. |
You're totally right, awaiting them makes my issue disappear. Thanks and sorry about that. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Not a problem! |
The MRE below always generates the same appearance in the terminal and snapshot_report.html,
but creates non-identical svg files leading to snap_compare failures (well sometimes, sometimes not).
Seemingly since textual 0.80
I've created a small git repo with the MRE and svg test samples here:
https://github.com/mitaa/mre_textual_svg_dtree
After taking 20 samples with each version i get the following
The difference within the svg files seem to be the UIDs (
.terminal-
) here2769b26e6544461cc1d3d5c6344a64b9353f7e6ef6fcd80417dfb929dfa79089.svg
924cf504886288b5587dc86f2e517aaa5e8d89e7abd320f72a6afef013ecb8d9.svg
MRE code from the repo:
mre.py
sample.py
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: