Importing from sub-folder hierarchy in python

Viewed 13968

i am trying to import specified modules from test_file hierarchy

something like :

test_case1.py
test_subsuite_2
test_sub_2.1.1.py
test_suite2

is it possible to do a run import on this hierarchy

/project/main.py
/project/test_files

test_files folder hierarchy is like this :

test_files
    test_suite1
        test_case1.py
        test_subsuite_1
            test_sub1_1.py
            test_sub1_2.py
        test_subsuite_2
            test_subsuite_2_1
                test_sub_2.1.1.py
            test_sub2_1.py
            test_sub3_2.py

    test_suite2
        test_case2.py
        test_subsuite2_1
            test_sub21_1.py
            test_sub21_2.py
        test_subsuite2_2
            test_sub22_1.py
            test_sub23_2.py
2 Answers
Related