Scenario: I have a function which is going to instantiated in different test_.py files

EX: 
test_name1.py
test_name2.py
test_name3.py

instance name is tools.py and will be created in with same name in all of the above test files.

now I would need to import this instance in another file (Ex: utils.py). For ex, if I run the test_name1.py, instance from this file should get imported to utils.py and if I run the test_name2.py, instance from this file should get imported to utils.py. like this

I want to achieve some thing like

test_file == "test_name1.py":
from root.fold1.fold2.{test_file} import tools

Is there a way to achieve this ?

0

There are 0 answers