-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Clean test_format.py #9227
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
Conversation
@alanhdu I am not very familiar with these tests, but doesn't it just do what the comment says? "Make sure each row has this ... in the same place" So it iterates over the rows of the dataframe ( But, I see now, probably there was just a mistake in the loop that |
Replacing the |
yes, because the As in:
So the test was indeed somewhat to simple. The question is if this should be tested ( cc @bjonen ? |
Perhaps a compromise is to test if there is at least one '...' in each line. |
@@ -55,11 +53,7 @@ def has_horizontally_truncated_repr(df): | |||
except: | |||
return False | |||
# Make sure each row has this ... in the same place | |||
r = repr(df) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would restore this section. You are testing something slightly different here.
@alanhdu minor restoration. pls squash and get this in. |
@bjonen In [21]: w = pd.get_option("display.max_rows") + 1
In [22]: pd.DataFrame({k: np.arange(5) for k in np.arange(w)})
Out[22]:
0 1 2 3 4 5 6 7 8 9 ... 51 52 53 54 55 56 57 58 \
0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 ... 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3 ... 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4 4 ... 4 4 4 4 4 4 4 4
59 60
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
[5 rows x 61 columns] |
@jreback Reverted and squashed. |
Can you rebase? Currently it cannot be merged as is. Normally:
and then push force should suffice. |
* pd -> pandas * assert statement -> nosetest assert
Rebased. |
@alanhdu thanks! |
Mostly just stylistic changes. The only substantive one is the test now on line 56 (
has_horizontally_truncated_repr
). I can't figure what the test was supposed to be doing. Suggestions?Original Test:
New Test: