# Help designing unit tests?

**URL:** <https://forum.inductiveautomation.com/t/help-designing-unit-tests/68544>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 12, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/help-designing-unit-tests/68544 "2023-01-12T16:58:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![PFollansbee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pfollansbee/32/46440_2.png) [@PFollansbee](https://forum.inductiveautomation.com/u/PFollansbee)\
**Post date:** [June 23, 2024, 6:43am UTC](https://forum.inductiveautomation.com/t/help-designing-unit-tests/68544/5 "2024-06-23T06:43:38Z")

</div>

I've been trying to find a way for this to run in all the loaded modules in the Project Library without having to type the module names into the test each time I run it. Is there a nice way to do this?

I've tried some things along the lines of

> [@Script File List](https://forum.inductiveautomation.com/t/script-file-list/17799):
>
> Hello, From within a script, I would like to get a list of all the modules in the project. I can get all the imported modules using this: import sys for name, module in sys.modules.items(): if 'project' in name: print name but I would like to get a list of all modules (or filenames), even if they haven’t been imported yet. As they haven’t been imported, I may need to query the underlying structure where the modules are stored, but I have no idea of how to do this? Any ideas?

and

> [@Script to list all library script functions](https://forum.inductiveautomation.com/t/script-to-list-all-library-script-functions/64639/6):
>
> A function object from a script module has substantial information attached. Try this (and variations) in your script console: def myFunc(arg1, \*args): pass for x in dir(myFunc): a = getattr(myFunc, x) print x, type(a), repr(a) Note the stuff at the end: \_\_call\_\_ \<type 'builtin\_function\_or\_method'\> \<built-in method \_\_call\_\_ of function object at 0x2\> \_\_class\_\_ \<type 'type'\> \<type 'function'\> \_\_closure\_\_ \<type 'NoneType'\> None \_\_code\_\_ \<type 'tablecode'\> \<code object myFunc at 0x3, file "\<…

but it seemed like there should be an easier way. I'm sure that with enough digging through, you could determine which modules are being loaded through the Project Library, which are being imported, and which are automatically loaded, but this seems like an unnecessary amount of work for something that should be fairly trivial.

Apologies if this should be in a separate thread, but it seemed relevant to this thread and anyone who might stumble on it in the future.

Thanks!

---

_[View the full topic](https://forum.inductiveautomation.com/t/help-designing-unit-tests/68544)._
