Skip to content
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

BUG: generate-diff removes part of command not just the output #252

Closed
bsipocz opened this issue Jun 26, 2024 · 2 comments · Fixed by #253
Closed

BUG: generate-diff removes part of command not just the output #252

bsipocz opened this issue Jun 26, 2024 · 2 comments · Fixed by #253
Labels

Comments

@bsipocz
Copy link
Member

bsipocz commented Jun 26, 2024

I run into this diff with a pyvo narrative docs file, where the print has been erroneously removed.

cc @seberg in case you have an idea what goes wrong (besides that the doc would probably benefit of a refactor that removes the printing in for loop altogether)

--- a/docs/dal/index.rst
+++ b/docs/dal/index.rst
@@ -719,17 +719,17 @@ Iterating over a resultset gives the rows in the result:
 .. doctest-remote-data::
 
     >>> for row in resultset:
-    ...     print(row['s_fov'])
-    0.05027778
-    0.05027778
+    0.06527778
+    0.06527778
+    0.06527778
+    0.06527778
+    0.06527778
+    0.06527778
     0.05027778
     0.05027778
     0.05027778
     0.05027778
     0.06527778
-    0.06527778
-    0.06527778
-    0.06527778
 
 The total number of rows in the answer is available as its ``len()``:
@bsipocz bsipocz added the bug label Jun 26, 2024
@seberg
Copy link
Contributor

seberg commented Jun 26, 2024

My guess is that I replace lines in the file, but completely forgot to account for the possibility of multi-line input. (i.e. doctest plus finds it as the first line, but it spans more than one line, so the result ends later).

@bsipocz
Copy link
Member Author

bsipocz commented Jun 26, 2024

Oh, that may also explain why it left one of the 0.06527778 lines at the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants