Feature Request : Automatic Unit Test creation

Hello,

a great feature would be the generation of unit tests for classes and methods/functions.

1. hover over function

2. Click create unit test

3. Unit test code is created


3.1 The types of the input and output variables are inferred from the sourcecode and/or doctest. Based on the infered types, respective assert statements are automatically generated. For instance,


- type checking of input and output

3.2 if the docstring contains a doctest, the doctest is added to the unit test

3.3 Once the input and output types are infered, additional tests ala QuickCheck are created

See http://en.wikipedia.org/wiki/Quickcheck for information on QuickCheck

4. Ability to list all classes/methods/functions that don't have a corresponding unit test

- in that way we can make sure all and every function is tested

My 2 cents on testing in PyCharm

Frank

2 comments

Hello Frank,

I don't think this would really be feasible as a core product feature. Automatic

unit test generation has been attempted multiple times, and as far as I understand

none of the attempts have seen much success. This can be developed as a third-party

plugin, and you're welcome to try it if you're interested in working on it

yourself, but as for the core product functionality, we'd rather finish the

non-speculative parts first. :-)

a great feature would be the generation of unit tests for classes and

methods/functions.

1. hover over function

2. Click create unit test

3. Unit test code is created

3.1 The types of the input and output variables are inferred from the

sourcecode and/or doctest. Based on the infered types, respective

assert statements are automatically generated. For instance,

- type checking of input and output

3.2 if the docstring contains a doctest, the doctest is added to the

unit test

3.3 Once the input and output types are infered, additional tests ala

QuickCheck are created See http://en.wikipedia.org/wiki/Quickcheck for

information on QuickCheck

4. Ability to list all classes/methods/functions that don't have a

corresponding unit test - in that way we can make sure all and every

function is tested

My 2 cents on testing in PyCharm

Frank

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Thank you for your quick feedback and response.

PyCharm rocks!

Frank

0

Please sign in to leave a comment.