question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enum completion must have a type annotation

See original GitHub issue

Enum conversion will not happen correctly without type annotation. Right: assertion_operator: AssertionOperator = AssertionOperator.NO_ASSERTION Wrong: assertion_operator = AssertionOperator.NO_ASSERTION

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xylixcommented, Jul 1, 2020

No my point was that the Get Title assertion_operator type is in the wrong way. But it works correctly. Trying to run Get Title NO_ASSERTION in robot test also works correctly, so it does cast the enum correctly.

I thanks I misunderstood what kind of test you were referring to in Run keyword and expect error test required. The examples on the thread’s first message don’t have Optional at all, and that was the only type conversion problem I was aware of.

1reaction
mkorpelacommented, Jul 1, 2020

Run keyword and expect error test required

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type annotations for Enum attribute - python - Stack Overflow
Each value will have a type of Enum class. This means that for the code example below we will be able to put...
Read more >
Better mypy typing for enum values in python #8175 - GitHub
I'd like to propose adding V = int runtime type alias to the EnumTypeWrapper (in enum_type_wrapper.py) - to avoid the need for this...
Read more >
Enum Mappings with Hibernate - The Complete Guide
Most developers use enums in their domain models. You can easily map them with Hibernate. They provide a strongly typed way to model...
Read more >
Validations for Enum Types - Baeldung
For this, we can create an annotation that checks if the String is valid for a specific enum.
Read more >
Enum HOWTO — Python 3.11.1 documentation
A new Enum class must have one base enum class, up to one concrete data type, and as many object -based mixin classes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found