Coder Social home page Coder Social logo

pytest-cov collection about cli-tools HOT 3 CLOSED

iot-lab avatar iot-lab commented on August 16, 2024
pytest-cov collection

from cli-tools.

Comments (3)

aabadie avatar aabadie commented on August 16, 2024

it will always try to collect every test in the iotlabcli/ hierarchy

What do you mean by this ? It runs all tests or it displays coverage for all tests ?

I tried locally and there's indeed an issue when one wants to only run pytest on a single test. Example:

$ iotlabcli/tests/profile_test.py::TestM3Profile::test_valid_empty_profile

doesn't work: all tests are run. But this is not related to pytest-cov. I could fix it with the following pytest config (in setup.cfg):

[tool:pytest]
addopts = -v --ignore iotlabcli/integration
          --cov=iotlabcli --cov-report=term --cov-report=xml --cov-report=html
          --junit-xml=test-report.xml
          --doctest-modules
          --pep8
testpaths = iotlabcli

Using an empty PYTEST_ADDOPTS variable is not a good solution, since it will also clear other options (--doctest-module, --pep8, etc).

Also, having the global coverage when running a single test makes no sense and maybe the options related to coverage should be moved to the tests env in tox.ini. I tried that and it works well, will PR this, so you can try.

from cli-tools.

aabadie avatar aabadie commented on August 16, 2024

@rienafairefr, see #29

from cli-tools.

rienafairefr avatar rienafairefr commented on August 16, 2024

OK. Looks fixed by #29

from cli-tools.

Related Issues (15)

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.