Skip to content

"Generate Tests" is disabled for Python file which contains only class #2128

Description

@tyuldashev

Description

In case python file has no top-level functions, but only one class, then user can generate tests from inside the file but not from project view.

To Reproduce

Steps to reproduce the behavior:

  1. Create Python file with has only class declaration with one or many methods.
  2. Right click on the file in Project view

Expected behavior

UTbot "Generate Tests" is disabled and can be invoked. At least in case there is only one class declaration in the file.

Actual behavior

Menu item is enabled.

Visual proofs (screenshots, logs, images)

image

Additional information
Inside the file but outside of class declaration test generation doesn't work either. Though if there is only one class in the file it should work.

Metadata

Metadata

Assignees

Labels

comp-ideIssue is related to IDE supportctg-bugIssue is a buglang-pythonIssue is related to python support

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions