Comments (3)
I am upgrading the "one and only version of coverage" in the Meta monorepo
Wow, OK! Let me know if other issues arise.
from coveragepy.
I would rather not try to make coverage defensive against aggressive monkeypatching in tests. How hard would it be to update the test? If you could patch the fake implementation where you use glob instead of in the glob module itself, it will have a more localized effect.
from coveragepy.
How hard would it be to update the test?
That's definitely the right thing to do :)
I'm sure it's not that hard to fix the specific test (it will require overhauling the patching strategy in that test though).
For context, I am upgrading the "one and only version of coverage" in the Meta monorepo, so I am not an expert on most of the millions of the affected tests.
If you could patch the fake implementation where you use glob instead of in the glob module itself, it will have a more localized effect.
looks like the test was actually trying to do that. glob was being imported in app/util.py
, and the test was patching app.util.glob.glob
. I guess this is one of those mock footguns, where the right thing to patch was app.util.glob
, and patching app.util.glob.glob
actually patches the glob
function in the builtin glob
module.
Interestingly, even calling mocked_glob.stop()
doesn't unpatch the builtin glob.glob
... but that's definitely out of scope for a coverage-specific issue :)
In any case, I'm totally ok with this being closed as "not a bug" / "user doing clowny things"!
from coveragepy.
Related Issues (20)
- Can we add a json schema to complete pyproject.toml's [tool.coverage]?
- Test suite gets stuck when running on Windows PyPy 7.3.15 HOT 11
- test suite gets really slow in pypy3.9-v7.3.15 on ubuntu 22.04.3 HOT 4
- notes on our experience upgrading coverage 5.4 -> 7.4 HOT 1
- Question: Can `no-cover` "cover" the rest of the function? HOT 2
- Question: How to get the coverage data for each incoming request on my web server. HOT 2
- "No data was collected" when passing --source containing new line separated list HOT 5
- Question: how to add a middleware located on a different folder in settings.py ? HOT 1
- How to exclude external packages from coverage report when using coverage.py API ? HOT 1
- Use PEP 669 Low Impact Monitoring to reduce overhead HOT 3
- How to automate a coverage report using .coveragerc file HOT 1
- How to only show functions that hasn't been covered? HOT 1
- Relative paths duplicates paths on Windows HOT 9
- Facing issue No source for code while combining multiple coverage files HOT 5
- Exclude_lines unable to exclude entire if block from coverage.py in 5.5 version. HOT 5
- Option to record and report classes and imports not used at runtime HOT 1
- Current approach to restarting data collection? HOT 1
- Want to get coverage for 3rd party dependencies' code used by my project. HOT 9
- Coverage html complains about parsing Aenum's _py2.py HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coveragepy.