Git Product home page Git Product logo

Comments (4)

vvnkr avatar vvnkr commented on June 22, 2024

Testing the definition is not possible ATM but I think you can test the functionality of a lambda function using test_expression_result().

E.g.

test_expression_result(expr_code="echo_word('ECHO!!', 5)")

This will compare the result of expr_code in the student and solution environment (and since these environments contain the defined lambda expression, it tests whether they return the same).

from pythonwhat.

filipsch avatar filipsch commented on June 22, 2024

@vincentvankrunkelsven thanks for sharing this.
@hugobowne The workaround that Vincent mentions indeed allows you to indirectly test a lambda functions, but it's not ideal.

I'll try to look into a decent way of providing support for lambda functions by start of week next week (August 8).

from pythonwhat.

filipsch avatar filipsch commented on June 22, 2024

@hugobowne a function test_lambda_function() that looks very much like test_function_definition() has been added; it'll be on staging soon.
Wiki article will be added here

from pythonwhat.

filipsch avatar filipsch commented on June 22, 2024

Will go live tomorrow

from pythonwhat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.