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

Increase coverage by ~0.37% and take a few files to 100% #590

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Increase coverage by ~0.37% and take a few files to 100% #590

merged 1 commit into from
Oct 17, 2022

Conversation

jmunoz94
Copy link

@jmunoz94 jmunoz94 commented Oct 17, 2022

This is related to #395. I did not increase coverage by 1%, but tried to tackle some larger files (by the end it became tedious so I did a couple of small files as well).

  • test/test_transitions.py could be refactored with parametrize. Since there would be many parameters, this may also involve creating a parameters.py. However, there are a bunch of files in the same folder so instead of moving files around or coming up with my own naming convention (such as parameters_transitions.py), I just added new tests using the same pattern that was used back in the day.
  • I updated drawing.py's line 1178 because I felt there was a typo there. The way it is it could trigger both line 177 and 181, causing an error because coerce does not handle None (which is not really consistent with having defaulted paint_rule to DONT_PAINT just before).
  • Many lines are not directly tested but covered because of side-effects (for example, because of the creation of certain objects to be used as expected values). I tried not to rely on that, but noticeably updated an unrelated test so that line 847 in shearing would get coverage.

Checklist:

  • The GitHub pipeline is OK (green),
    meaning that both pylint (static code analyzer) and black (code formatter) are happy with the changes of this PR.

  • A unit test is covering the code added / modified by this PR

  • This PR is ready to be merged

  • In case of a new feature, docstrings have been added, with also some documentation in the docs/ folder

  • A mention of the change is present in CHANGELOG.md

By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.

@Lucas-C
Copy link
Member

Lucas-C commented Oct 17, 2022

This is great, thank you @jmunoz94!
I have reviewed your code, and it's perfect for fpdf2 standards.
Merging this now!

@Lucas-C Lucas-C merged commit 11800d2 into py-pdf:master Oct 17, 2022
@Lucas-C
Copy link
Member

Lucas-C commented Oct 17, 2022

@all-contributors please add @jmunoz94 for tests

@allcontributors
Copy link

@Lucas-C

I've put up a pull request to add @jmunoz94! 🎉

@jmunoz94 jmunoz94 deleted the increase_test_coverage branch October 18, 2022 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants