Page MenuHomeSoftware Heritage

Migrate to pytest-style tests
ClosedPublic

Authored by vlorentz on Sep 16 2021, 11:54 AM.

Details

Summary

I want to use parametrized tests in a future commit, but pytest does not
support them on unittest-style classes.
self.subTest() would work too, but I figured it's a good time to migrate
these tests to be consistent with the rest of the codebase.

Diff Detail

Repository
rDLDG Git loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6279 (id=22740)

Rebasing onto 8ad9799f28...

Current branch diff-target is up to date.
Changes applied before test
commit 85eb54015c6ba2faba8e438a54a76fdc1aeb8e06
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Sep 16 11:49:26 2021 +0200

    Migrate to pytest-style tests
    
    I want to use parametrized tests in a future commit, but pytest does not
    support them on unittest-style classes.
    self.subTest() would work too, but I figured it's a good time to migrate
    these tests to be consistent with the rest of the codebase.

See https://jenkins.softwareheritage.org/job/DLDG/job/tests-on-diff/104/ for more details.

ardumont added a subscriber: ardumont.

Awesome! Thanks.

This revision is now accepted and ready to land.Sep 16 2021, 12:03 PM
olasd added inline comments.
swh/loader/git/tests/test_converters.py
118

I don't think this mark is useful anymore (it used to mark tests that would depend on resources external to the current package)

This revision was automatically updated to reflect the committed changes.