Skip to content

Commit

Permalink
Fix listener target
Browse files Browse the repository at this point in the history
  • Loading branch information
thisjustin123 committed Dec 9, 2024
1 parent 0ae6df8 commit b407913
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_object_listener():
custom = env.InstanceObject(name="CustomAttr", id=1, attr_type=attr.CustomAttr)

def object_listener(args):
nonlocal called
global called
called = True
dict = {}
for i, arg in enumerate(args):
Expand All @@ -97,7 +97,7 @@ def object_listener(args):
assert dict[12] == "tuple:"
assert dict[13] == "('a', 1, 0.5619999766349792)"

env.AddListenerObject("Collider_Box", object_listener)
env.AddListenerObject("DynamicObject", object_listener)

env.SendObject(
"DynamicObject",
Expand All @@ -111,7 +111,9 @@ def object_listener(args):
)

# Get data back...
env.step(10)
for _ in range(10):
env.step()

assert called

env.close()
Expand Down

0 comments on commit b407913

Please sign in to comment.