Page MenuHomeSoftware Heritage

swh.search.get_search: Simplify instantiation
ClosedPublic

Authored by ardumont on Aug 2 2020, 11:11 AM.

Details

Summary

This aligns with other get_* functions.
This also adds tests to this part.

This is preparatory work to improve and add consistent types and docstrings without duplication or typos.

Related to T2516

Test Plan

tox

Diff Detail

Repository
rDSEA Archive search
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 D3684 (id=12974)

Rebasing onto d285cd3f3b...

Current branch diff-target is up to date.
Changes applied before test
commit 58faacb5e95dc3bd9a55ec39c8bf06287b75879d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Sun Aug 2 11:05:07 2020 +0200

    swh.search.get_search: Simplify instantiation
    
    This aligns with other get_* functions.
    This also adds tests to this part.
    
    This is preparatory work to improve and type properly this module without
    duplication.
    
    Related to T645

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

vlorentz added a subscriber: vlorentz.

great, thanks

swh/search/tests/test_init.py
22–26

you can use pytest.parametrize instead, but that's ok too

This revision is now accepted and ready to land.Aug 3 2020, 9:14 AM

Use pytest parametrize instead

vlorentz added inline comments.
swh/search/tests/test_init.py
27

"If a function argument's name clashes with a reserved keyword, it is generally better to append a single trailing underscore rather than use an abbreviation or spelling corruption. Thus class_ is better than clss. (Perhaps better is to avoid such clashes by using a synonym.)"
https://www.python.org/dev/peps/pep-0008/#function-and-method-arguments

This revision now requires changes to proceed.Aug 3 2020, 10:09 AM

Build is green

Patch application report for D3684 (id=12977)

Rebasing onto d285cd3f3b...

Current branch diff-target is up to date.
Changes applied before test
commit 58a7f7f0d1a288a7b54eb66b05ee2c0b7fe01e5c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Sun Aug 2 11:05:07 2020 +0200

    swh.search.get_search: Simplify instantiation
    
    This aligns with other get_* functions.
    This also adds tests to this part.
    
    This is preparatory work to improve and type properly this module without
    duplication.
    
    Related to T645

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

Use proper names

swh/search/tests/test_init.py
22–26

thanks!

Build is green

Patch application report for D3684 (id=12978)

Rebasing onto d285cd3f3b...

Current branch diff-target is up to date.
Changes applied before test
commit 46af49019c220ad4f398944bf43130bd26288cda
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Sun Aug 2 11:05:07 2020 +0200

    swh.search.get_search: Simplify instantiation
    
    This aligns with other get_* functions.
    This also adds tests to this part.
    
    This is preparatory work to improve and type properly this module without
    duplication.
    
    Related to T645

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

This revision is now accepted and ready to land.Aug 3 2020, 10:35 AM