Closed hermansje closed 5 years ago
Merging #385 into master will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #385 +/- ##
==========================================
+ Coverage 94.08% 94.08% +<.01%
==========================================
Files 26 26
Lines 2113 2115 +2
==========================================
+ Hits 1988 1990 +2
Misses 125 125
Impacted Files | Coverage Δ | |
---|---|---|
pythonwhat/checks/has_funcs.py | 96.21% <100%> (+0.04%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5599e7e...9c7ddad. Read the comment docs.
I'm not 100% convinced this will work. If there is any expr_code out there that tries to use an empty dict, calling format on it will give a IndexError?
>>> expr_code = "mydict = {}"
>>> expr_code.format(focus="some code")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: tuple index out of range
As discussed, doing string replacement with __focus__
seems like a good idea.
It would be useful to be able to use the zoomed code in exprcode. We decided to use string replace on "__focus_\" instead of using format. Using format would not allow the use of {} anywhere in exprcode. "__focus_\ "is also replaced in the feedback message.
Usage:
expr_code="list(__focus__)"
Todo: Add usage to pyhtonwhat docs