CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
785 stars 75 forks source link

Detect missing test dependencies #207

Closed jayvdb closed 4 years ago

jayvdb commented 4 years ago

Idea comes from https://github.com/althonos/jinja2-fsloader/issues/1

At the end of a green test run, green could look at which modules were loaded during the tests and report them, or (more difficult) compare them against the project metadata to indicate which were missing.

CleanCut commented 4 years ago

I'm mostly going to redirect you to coverage for this!

Reporting loaded modules can be accomplished via coverage (-r/--run-coverage) and the desired combination of coverage-pattern-modifications! (Start with -O/--clear-omit, for example) -- though I don't think that's particularly elegant. I'd be okay plumbing through a coverage feature for this if one exists (or gets created), but I'm not planning on extending coverage's functionality inside Green.

Reporting modules that the programmer intended to load but didn't manage to load is also beyond the scope of Green's mission. Again, this sounds like something you'd want to do in coverage!

A .coverage file is left on disk after a coverage run -- there may be existing tools to extract information directly from there as well (and there's alway coverage itself 😄 ).