Comments (2)
I tried to replicate a similar situation and ran into a weird situation. If I have some similar code and run the coverage collection with pytest --cov=. --cov-context=test
and check how the coverage report looks, I get this:
So no test is recorded for the return key because there is no context for that line. But if change the source code like you did, the testname gets recorded:
I don't think I can come up with a fix for this with any pytest-cov flag. You can also check what kind of contexts your program has by setting
[html]
show_contexts = True
and checking the html report produced by coverage html
from pytest-rts.
Update: for my example, this seems to be python version specific. The above situation is with 3.6.6
and with 3.8.5
the testname is recorded for the line in both cases. I had pytest-cov 2.11.1
and coverage 5.5
during both.
from pytest-rts.
Related Issues (20)
- README updating HOT 1
- Describe how the tool works HOT 2
- Integrate with Robot Framework
- Add LICENSE.txt HOT 1
- Code in __init__.py is not tracked HOT 1
- If directory name contains 'pytest-rts', the tool does not work HOT 3
- Tests using data files should be re-run at data files change
- PRs merge strategy HOT 2
- problems running pytest-rts first time HOT 3
- avoid failing if executed not in a git repo
- Coverage percentage is lower with --rts flag HOT 1
- Indetermenistic database update HOT 2
- Run tests that are not yet added to git HOT 3
- Test selection fails when execution time is None
- pytest-cov integration: execution of new tests HOT 10
- Run tests related to changed lines HOT 3
- Non-zero return code from --rts HOT 2
- RTS strategy for newly added lines HOT 1
- Problems with PyDriller 2.x
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 pytest-rts.