harvard-lil / perma

Indelible links
417 stars 71 forks source link

Refactor test_capture_job.py #3415

Closed rebeccacremona closed 11 months ago

rebeccacremona commented 11 months ago

See ENG-415.

This PR refactors test_capture_job.py:

a) to use pytest fixtures powered by factory boy instead of our json fixtures

b) to use standard pytest syntax instead of the older unittest-style syntax

This was easy, because I basically already went through this exercise in https://github.com/harvard-lil/perma-capture/commit/b2fe7addb5c4d8c19769e4b552516726b3829761 and related commits, when building the prototype capture service.

I hope to be able to reuse a lot of that work (as intended), as this refactoring project proceeds!

Reviewing

The unified diff is very hard to read, but I think if you click through the individual commits, you'll be able to easily see at a glance that the tests haven't been changed.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c4527d4) 68.62% compared to head (ee508f6) 68.89%. Report is 3 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3415 +/- ## =========================================== + Coverage 68.62% 68.89% +0.26% =========================================== Files 53 53 Lines 7236 7297 +61 =========================================== + Hits 4966 5027 +61 Misses 2270 2270 ``` | [Files](https://app.codecov.io/gh/harvard-lil/perma/pull/3415?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=harvard-lil) | Coverage Δ | | |---|---|---| | [perma\_web/conftest.py](https://app.codecov.io/gh/harvard-lil/perma/pull/3415?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=harvard-lil#diff-cGVybWFfd2ViL2NvbmZ0ZXN0LnB5) | `90.90% <100.00%> (+7.81%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.