code objects analysis replaced with inspect#487
code objects analysis replaced with inspect#487Trizalio wants to merge 2 commits intoaio-libs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #487 +/- ##
==========================================
- Coverage 99.13% 98.52% -0.61%
==========================================
Files 13 11 -2
Lines 1043 952 -91
Branches 116 104 -12
==========================================
- Hits 1034 938 -96
Misses 9 9
- Partials 0 5 +5
Continue to review full report at Codecov.
|
|
i'm quite new in coverage checks, can someone tell me, how is |
|
Some tests are failing so it can be because of this as a side effect. Don't check coverage until the build passes |
This comment has been minimized.
This comment has been minimized.
|
Hey, sorry for the delay, if you can merge master and get this running again, then we can look at merging this. If I understand correctly, the test is only affected by function signatures, so you should also move the test to tests/ut/test_decorators.py and use a mock_cache instead. |
multi_cachedworks incorrectly with decorated functions, called withkeys_from_attrvalue passed as positional argument, example:This problem's reason is analysis of code object of function passed to
multi_cacheddecorator.To properly get arguments from function decorated with
functools.wraps, it's required to get signature of inner function. Which can be accessed by__wrapped__attribute, or byinspect.signaturefunction, which goes recursively through__wrapped__attributes till core function.I suggest to used
inspect.signatureinstead of direct code obejects inteaction.