py2cr icon indicating copy to clipboard operation
py2cr copied to clipboard

Support UnitTest to Crystal Spec conversion

Open nanobowers opened this issue 2 years ago • 0 comments

It would be useful to be able to convert the python unittest format (the default and core library for python testing) into the Spec format that Crystal uses. This may require some heavy tree manipulation and require taking some opinionated positions with the translation.

Something like:

  • each Python class that interits unittest.TestCase be converted into a describe
  • each test_* function in the class be converted into a it
  • each self.assert* convert into the appropriate should clause, which will require rearrangement, especially for exception handling.
  • support for setUp/tearDown, though the semantics differ significantly between cases.

Adding this in may eventually allow for easier and faster regression of some parts of this project, as the current methodology suffers from "death by a thousand compiles"

nanobowers avatar Jan 21 '23 16:01 nanobowers