Skip to content

REF: rearrange test_to_latex.py #36714

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

Merged
merged 4 commits into from
Sep 30, 2020
Merged

Conversation

ivanovmg
Copy link
Member

@ivanovmg ivanovmg commented Sep 28, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Rearranged tests in test_to_latex.py to the corresponding classes.
Sorry for the messy diffs.
All I did (except to small commits cd92db9 and 2b66e2f) was rearrangement of the tests.

@jreback jreback added IO LaTeX to_latex Testing pandas testing functions or related to the test suite labels Sep 30, 2020
@jreback jreback added this to the 1.2 milestone Sep 30, 2020
@jreback
Copy link
Contributor

jreback commented Sep 30, 2020

can you just confirm that before & after test counts are the same for latex.

@ivanovmg
Copy link
Member Author

ivanovmg commented Sep 30, 2020

"Added" tests:

$ git diff e260f58^..8815c7f | grep "^+.*def test_" | wc -l
44

"Deleted" tests:

$ git diff e260f58^..8815c7f | grep "^-.*def test_" | wc -l
43

One extra test was added: test_to_latex_column_format_just_works as a result of splitting test_to_latex_column_format.
Originally test_to_latex_column_format basically comprised two tests: one to check that column format just works without failing for dataframe float_frame (fixture) and the second one to test result vs expected for small dataframe. I extracted the test _just_work for the float_frame.

Comment on lines -155 to 108
def test_to_latex_column_format(self, float_frame):
def test_to_latex_column_format_just_works(self, float_frame):
# GH Bug #9402
float_frame.to_latex(column_format="lcr")

def test_to_latex_column_format(self):
df = DataFrame({"a": [1, 2], "b": ["b1", "b2"]})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I extracted tests _just_works.

@jreback jreback merged commit 84acb08 into pandas-dev:master Sep 30, 2020
@jreback
Copy link
Contributor

jreback commented Sep 30, 2020

thanks @ivanovmg

@ivanovmg ivanovmg deleted the refactor/test-latex branch October 4, 2020 13:25
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO LaTeX to_latex Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants