Giter VIP home page Giter VIP logo

Comments (7)

mgeier avatar mgeier commented on July 19, 2024

To check coverage locally I installed pytest-cov from https://pypi.python.org/pypi/pytest-cov and then ran:

py.test --cov pysoundfile.py

This prints a small summary on the terminal. To get a much nicer and very detailed HTML coverage report I did this:

py.test --cov pysoundfile.py --cov-report html

It can also check the coverage of the test code itself:

py.test --cov tests/ --cov-report html

from python-soundfile.

mgeier avatar mgeier commented on July 19, 2024

An alternative way to check the coverage is coverage.py.

coverage run --source pysoundfile.py -m py.test
coverage html

An advantage over the pytest-cov plugin is that it can check branch coverage:

coverage run --branch --source pysoundfile.py -m py.test
coverage html

from python-soundfile.

mgeier avatar mgeier commented on July 19, 2024

BTW, I changed my opinion regarding automated coverage reports:
We should not advertise the percentage of coverage because it is a very un-reliable metric for the quality of the code.
Therefore, automated coverage reports (e.g. after each commit) are not necessary.

I still think coverage reports are a useful tool for improving the tests, but it is sufficient to run coverage analysis locally.
We should probably add the aforementioned commands in the README file (#26).

from python-soundfile.

bastibe avatar bastibe commented on July 19, 2024

All of this sounds very reasonable. I agree that we don't need to advertise coverage in the README.

I think that the README should be primarily focused on getting users up to speed with the library. Coverage is probably not something a user is very concerned with (except maybe as a weak measure of code quality). I therefore think that it is unnecessary to even put the commands in the README.

Plus, we don't ship any special accomodations for coverage reports and you can use any coverage tool you like to generate coverage reports. This is another reason why we probably should not put instructions for one particular tool into the README.

This is purely my intuition talking though. We could look at a few other projects and see how they are doing it.

from python-soundfile.

mgeier avatar mgeier commented on July 19, 2024

OK, the README is probably the wrong place for that.

But I think it could be nice to have a section somewhere in the Sphinx documentation for potential contributors where we could mention the tools we use on the development side.
This would also serve as a reminder for me, because I tend to forget the exact command line arguments.

from python-soundfile.

bastibe avatar bastibe commented on July 19, 2024

Great idea!

from python-soundfile.

mgeier avatar mgeier commented on July 19, 2024

As we agreed that automated coverage reports are not necessary, I'm closing this issue.

Documentation of coverage tools will be done in #66.

from python-soundfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.