unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
344 stars 145 forks source link

Ignore _about.py in pytest coverage #2379

Open purva-thakre opened 1 month ago

purva-thakre commented 1 month ago

Related to two of the items in #2365

  1. mitiq/_about.py
  2. mitiq/pec/representations/optimal.py
codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 98.68%. Comparing base (aefc5ce) to head (891b9b5). Report is 18 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2379 +/- ## ========================================== + Coverage 98.32% 98.68% +0.35% ========================================== Files 87 86 -1 Lines 4059 4026 -33 ========================================== - Hits 3991 3973 -18 + Misses 68 53 -15 ```

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

purva-thakre commented 1 month ago

@cosenal This one's ready to be merged as well. Unless we don't want to ignore this file from the pytest coverage report.

purva-thakre commented 6 days ago

Should there be tests for this function, however?

I was confused if this file needs to have unit tests. # pragma: no cover was selectively used in that file before I added the entire file to ignore in coveragerc

natestemen commented 6 days ago

I was confused if this file needs to have unit tests.

A test that ensures mitiq.about() returns a string seems reasonable. I wouldn't want to test much more than that, however. Definitely low priority.

purva-thakre commented 6 days ago

A test that ensures mitiq.about() returns a string seems reasonable.

Output of mitiq.about() is NoneType not str. Mostly because we use print to return the output of mitiq.about().

natestemen commented 6 days ago

Output of mitiq.about() is NoneType not str.

You're right! I shouldn't have said "... returns a string".

Exactly as you say, the type annotations denote return types, without any indication if something is printed to standard out, standard error, or any other external action is taken. What I'm lightly suggesting (again, low priority) is we ensure that mitiq.about() prints to standard out.