Code Monkey home page Code Monkey logo

Comments (16)

ionelmc avatar ionelmc commented on July 17, 2024

They appear if you use subprocesses or xdist.

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

They don't get removed at the end of the testrun?!

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Ah, that's a useful bit of information. Yes, I use subprocess and on error, I sys.exit() so they probably cannot be cleaned up. Do you have an idea? Here is the code inside setup.py.

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

I mean, if you use subprocesses in your tests, then pytest-cov will automatically start measuring coverage in those processes (if they are python of course). That's what is making those files (besides using xdist).

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Oh, I don't use subprocess in my tests, just in my setup.py to run pytest.

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

Does it reproduce without the setup.py shim?

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Just tried that. The files are still created when I just run python -m pytest --cov=layered test or py.test --cov=layered test. Pytest version 2.8.5 and Pytest-cov version 2.2.0.

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

What's your coverage version?

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Coverage is version 4.0.3. Pip says all of the three packages are up-to-date. Update: I just noticed messages of this form in the Pytest report:

Coverage.py warning: Couldn't read data from '/home/danijar/repository/layered/.coverage.danijar-xps13-arch.22012.752324': CoverageException: Doesn't seem to be a coverage.py data file

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

Is there a repository that reproduce the issue?

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Yes, cloning danijar/layered and running python3 setup.py test reproduces the problem.

from pytest-cov.

iAnanich avatar iAnanich commented on July 17, 2024

Have the same issue when using asyncio with ProcessPoolExecutor.

At the testing, it is a lot of .coveage.<..> files, but 2 of them always not get removed after tests complete.

python 3.5.3, coverage==4.4.1 pytest==3.0.6 pytest-cov==2.5.1

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

So I've looked at @danijar code and I bet @iAnanich has the same problem: unclean multiprocessing pool shutdown. You should have a pool.join() or similar before the test using the pool is done.

from pytest-cov.

danijar avatar danijar commented on July 17, 2024

Thanks for looking into this!

from pytest-cov.

drorata avatar drorata commented on July 17, 2024

I have a similar issue when testing a piece of code which uses GridSearchCV. Under the hood, joblib.Parallel is used and I guess/understand that it somehow messes up the files generated.

Any idea how to resolve this issue?

from pytest-cov.

ionelmc avatar ionelmc commented on July 17, 2024

@danijar pls open up a separate issue and give some details.

from pytest-cov.

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.