Skip to content

Python test generation error #1478

@alisevych

Description

@alisevych

Description

Python test generation error is showing for quite simple python functions, including examples on utbot.org

To Reproduce

  1. Install one of the latest plugin builds from main in IntelliJ Idea 2022.2.3
  2. Install Python plugin from MarketPlace
  3. Create a Python project
  4. Add the following code to it:
def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.

def div(a, b):
    return a / b

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')
  1. Press Alt+Shift+U in code
  2. Select both functions and generate tests
  3. Agree to install suggested requirements
  4. Make 5-6 steps once again

Expected behavior

Tests are supposed to be generated.

Actual behavior

An error dialog is show with the following test:
Cannot create tests for the following functions: print_hi, div

Visual proofs (screenshots, logs, images)

image

Environment

Windows 10 Pro
IntelliJ IDEA 2022.2.3 (not latest)

Additional context

Same with pytest or increased timeouts or manually create test sources root.
Generating tests... is displayed in inline progress.

Metadata

Metadata

Labels

ctg-bugIssue is a buglang-pythonIssue is related to python supportpriority-blockerBug blocking some of the main featuresstatus-verifiedBug fix is verified

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions