Skip to content

Conversation

bernt-matthias
Copy link
Contributor

@bernt-matthias bernt-matthias commented Jul 22, 2020

Just an idea. No idea if useful / correct. Might be better to do it at another place.

I guess also regular expressions testing if the extracted value is really an integer, float, list, ... would be a good idea.

Copy link
Collaborator

@multimeric multimeric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a test case, following the same points from #15.

A data type used in the command-line
"""

default: object = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Firstly, can this type annotation be optional please? e.g. Optional[object]
  • Secondly, and this is annoying I know, but could you add a type annotation override for the subclasses, such that CliInt has default: Optional[int] etc?

@bernt-matthias
Copy link
Contributor Author

Please also add a test case

Can do, but I never found the time to learn these python testing frameworks. If you could provide me the framework I can fill in the details I guess.

@multimeric
Copy link
Collaborator

The framework is pytest, which is the simplest testing framework. You just define a test_x function and put some assert statements inside it. See this file for some simple examples: https://github.com/aCLImatise/CliHelpParser/blob/master/test/name_generation/test_description.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants