datacamp / pythonwhat

Verify Python code submissions and auto-generate meaningful feedback messages.
http://pythonwhat.readthedocs.io/
GNU Affero General Public License v3.0
69 stars 31 forks source link

Add test for function calls in return statements #374

Closed TimSangster closed 5 years ago

TimSangster commented 5 years ago

Add test for function calls in return statements

codecov[bot] commented 5 years ago

Codecov Report

Merging #374 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #374   +/-   ##
=======================================
  Coverage   94.08%   94.08%           
=======================================
  Files          26       26           
  Lines        2113     2113           
=======================================
  Hits         1988     1988           
  Misses        125      125

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 9d76560...f1a5b8c. Read the comment docs.

hermansje commented 5 years ago

Because code coverage did not hit the new lines, I investigated and found visiting the Return node should already be handled here: https://github.com/datacamp/pythonwhat/blob/2e69aa22941c75ae731d395be26879622568249d/pythonwhat/parsing.py#L769-L771

The test could still be useful. I wonder what SCT behaviour made us think it wasn't supported, probably a different parsing improvement. Now that we have _debug it should be easier to localise problems in the future.

TimSangster commented 5 years ago

the parametrize isn't needed here

You're right, thanks!