HEPData / hepdata

Repository for main HEPData web application
https://hepdata.net
GNU General Public License v2.0
40 stars 11 forks source link

tests: add test for `add_analyses` function #809

Open GraemeWatt opened 2 weeks ago

GraemeWatt commented 2 weeks ago

I merged PR #808 even though the test coverage decreased by -0.006% since it is within the tolerance of -0.02%. The new uncovered line is:

https://github.com/HEPData/hepdata/blob/32b9fb77a9183d8263e3354ead3850ed4c4d339f/hepdata/ext/opensearch/document_enhancers.py#L116-L117

The other lines in add_analyses are tested indirectly, for example, doi_minter_test.py imports ins1748602 that includes a HistFactory file. I couldn't work out an easy way of modifying the existing tests to cover the above line. We could wait until a record is finalised that includes a ProSelecta file, then import it with import_records to cover the above line, but it would be better to add a dedicated test for the add_analyses function that covers all supported analysis types (currently: Rivet, MadAnalysis, HistFactory and NUISANCE).