Skip to content

Converting Python testscript to TESTed - errors with OOP excercise #5257

Discussion options

You must be logged in to vote

Also my apologies for missing this!


For the first two points, the issue is that we currently don't support running arbitrary functions, and don't have a programming-language independent way of doing print/repr (and there are no concrete plans for supporting it soon).

However, we do have language-specific literals for this use case (see the docs here). They do have some drawbacks, but they are a good fit in this case.

For example, transform this:

- statement: 'punt1 = Punt(1.0, 1.0)'
- expression: 'punt1.__repr__()'
  return: "(1.0, 1.0)"

To this:

- statement: 'punt1 = Punt(1.0, 1.0)'
- expression:
    python: 'repr(punt1)'
  return: "(1.0, 1.0)"

This way, the expression is not limited to…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@marcothijs
Comment options

Comment options

You must be logged in to vote
1 reply
@marcothijs
Comment options

Answer selected by marcothijs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants