ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand and python folder structures

Solved!
Go to solution

I am using Python 3.6 and teststand 2016 and having some issues with importing modules. I am getting "Unable to import the specified module due to the following error" found in the Configure Python Step in the Python Module Options.

 

Example folder structure:

/projects/modules/somemodule.py

/projects/tests/runthisunittest.py

 

Example Code of runthisunittest.py:

from modules.somemodule import somemodule

.

.

some code to run tests using somemodule class....

 

Question:

Is it possible to run this code above? How would I need to restructure my code?

 

 

0 Kudos
Message 1 of 3
(3,773 Views)
Solution
Accepted by topic author teststanduser110

Option 1:

Copy your /project/modules directory under /projects/tests.

Basically, 'modules' directory and 'runthisunitest.py' file should be in same directory.

 

Option 2:

To you PATH environment variable, add absolute path for /projects/modules

 

-Shashidhar

Message 2 of 3
(3,597 Views)

Thank you for your reply. Option 1 works for me.

0 Kudos
Message 3 of 3
(3,562 Views)