Description
Description
In case code uses method from another file then Python UTBot cannot generate test due cannot find that module.
To Reproduce
Steps to reproduce the behavior:
- Create two py files with following code:
# file a
def sum(a, b):
return a + b
#-------------------------------------------------
# file b
import a
def double_sum(n):
return a.sum(n, n)
- Generate tests for
double_sum(n)
Expected behavior
Tests are generated
Actual behavior
No matter what state of Visit only specified source
option tests are not generated.
Visual proofs (screenshots, logs, images)
idea.log is full with such errors:
2022-12-21 17:42:25,539 [1904978] INFO - STDOUT - | UtBot - PythonEngine | Error evaluation: 1, , [Traceback (most recent call last):, File "C:\Users\T00814~1\AppData\Local\Temp\UTBot\python-test-generation-191213119845437442179195\2008_run_double_sum.py", line 4, in <module>, from mod1.b import *, File "C:\Users/t00814305/IdeaProjects/Python/Python3\mod1\b.py", line 1, in <module>, import a, ModuleNotFoundError: No module named 'a']
Additional context
Once I've got a bit different errors in idea.log, but cannot reproduce it now. isArmstrong
is a function I was testing:
2022-12-21 17:29:06,337 [1105776] INFO - STDOUT - | UtBot - PythonEngine | Error evaluation: 1, , [Traceback (most recent call last):, File "C:\Users\T00814~1\AppData\Local\Temp\UTBot\python-test-generation-78110564449218154754105\867_run_isArmstrong.py", line 8, in <module>, isArmstrong,, ^^^^^^^^^^^, NameError: name 'isArmstrong' is not defined]
Metadata
Metadata
Assignees
Type
Projects
Status
Done