Page MenuHomeSoftware Heritage

test_hashutil: Port tests from unittest to pytest
ClosedPublic

Authored by anlambert on Dec 6 2021, 4:07 PM.

Details

Summary

One more legacy test file ported to pytest, still a couple of test files
to process in swh-model though.

Diff Detail

Event Timeline

Build has FAILED

Patch application report for D6752 (id=24515)

Rebasing onto 8d96dfedee...

First, rewinding head to replay your work on top of it...
Applying: test_hashutil: Port tests from unittest to pytest
Changes applied before test
commit a7d0cfae18fb1fb66be3fac6ef08bc0e8fdf0ee9
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 6 16:02:58 2021 +0100

    test_hashutil: Port tests from unittest to pytest

Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/404/
See console output for more information: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/404/console

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 6 2021, 4:09 PM
Harbormaster failed remote builds in B25389: Diff 24515!

Fix port of assertIs assertions

Build has FAILED

Patch application report for D6752 (id=24516)

Rebasing onto 8d96dfedee...

First, rewinding head to replay your work on top of it...
Applying: test_hashutil: Port tests from unittest to pytest
Changes applied before test
commit 464cbc73f3efec27efa7bea428a4d9be14479d87
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 6 16:02:58 2021 +0100

    test_hashutil: Port tests from unittest to pytest

Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/405/
See console output for more information: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/405/console

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 6 2021, 4:25 PM
Harbormaster failed remote builds in B25390: Diff 24516!

Fix failing tests due to mistakes in the porting process

Build is green

Patch application report for D6752 (id=24519)

Rebasing onto 8d96dfedee...

First, rewinding head to replay your work on top of it...
Applying: test_hashutil: Port tests from unittest to pytest
Changes applied before test
commit f44d07eaf970fabb285225c6fd22d9eb9ea01e36
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 6 16:02:58 2021 +0100

    test_hashutil: Port tests from unittest to pytest

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

Build is green

Patch application report for D6752 (id=24522)

Rebasing onto 8d96dfedee...

Current branch diff-target is up to date.
Changes applied before test
commit 4a53fdcae885fdfb235c6b5df139e630ad088fc4
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 6 16:02:58 2021 +0100

    test_hashutil: Port tests from unittest to pytest

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

ardumont added a subscriber: ardumont.

"Blue blue, super blue!"

swh/model/tests/test_hashutil.py
187

nice addition

286

apparently, jenkins node does not have those deps, hence the coverage miss ;)

This revision is now accepted and ready to land.Dec 6 2021, 5:48 PM
swh/model/tests/test_hashutil.py
286

If I recall correctly, that test was for Python versions (< 3.5) with no built-in support for blake2.

It makes me think that we could drop the associated code in hashutil and those tests as we are using Python 3.7 in production.

Add an autouse fixture to reset the blake2 cache

Build is green

Patch application report for D6752 (id=24524)

Rebasing onto 8d96dfedee...

Current branch diff-target is up to date.
Changes applied before test
commit 243520daa82790ba05e8e88feea3065e905c03db
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Mon Dec 6 16:02:58 2021 +0100

    test_hashutil: Port tests from unittest to pytest

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