From 6d96f9265087801863e7ac35ec9c86b5a1d3d31c Mon Sep 17 00:00:00 2001 From: "C. Allwardt" <3979063+craig8@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:28:17 -0800 Subject: [PATCH] don't import agent into the global space for tests. --- volttrontesting/utils/build_agent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/volttrontesting/utils/build_agent.py b/volttrontesting/utils/build_agent.py index a925d9fc09..0f5b0af6f3 100644 --- a/volttrontesting/utils/build_agent.py +++ b/volttrontesting/utils/build_agent.py @@ -3,7 +3,6 @@ import gevent from volttron.platform.keystore import KeyStore -from volttron.platform.vip.agent import Agent from volttrontesting.utils.platformwrapper import PlatformWrapper @@ -13,9 +12,11 @@ def build_agent(platform: PlatformWrapper, identity=None, agent_class=None): The agent identity will be set. If the identity is set to None then a random identity will be created. """ + from volttron.platform.vip.agent import Agent + if agent_class is None: agent_class = Agent - + os.environ['VOLTTRON_HOME'] = platform.volttron_home agent = platform.build_agent(identity, agent_class=agent_class) gevent.sleep(0.1) # switch context for a bit