4
4
import random
5
5
import json
6
6
import pytest
7
+ import warnings
7
8
import jsonschema
8
9
import numpy as np
9
10
from ai2thor .controller import Controller
@@ -32,7 +33,12 @@ class ThirdPartyCameraMetadata:
32
33
def build_controller (** args ):
33
34
default_args = dict (scene = "FloorPlan28" , local_build = True )
34
35
default_args .update (args )
35
- return Controller (** default_args )
36
+ # during a ci-build we will get a warning that we are using a commit_id for the
37
+ # build instead of 'local'
38
+ with warnings .catch_warnings ():
39
+ warnings .simplefilter ("ignore" )
40
+ c = Controller (** default_args )
41
+ return c
36
42
37
43
38
44
wsgi_controller = build_controller (server_class = WsgiServer )
@@ -140,7 +146,6 @@ def test_small_aspect():
140
146
controller .stop ()
141
147
142
148
143
- @pytest .mark .skip (reason = "temporarily skipping deprecation test" )
144
149
def test_bot_deprecation ():
145
150
controller = build_controller (agentMode = "bot" , width = 128 , height = 64 )
146
151
assert (
@@ -157,11 +162,13 @@ def test_deprecated_segmentation_params():
157
162
renderClassImage = True ,
158
163
)
159
164
event = controller .last_event
160
- assert event .class_segmentation_frame is event .semantic_segmentation_frame
161
- assert event .semantic_segmentation_frame is not None
162
- assert (
163
- event .instance_segmentation_frame is not None
164
- ), "renderObjectImage should still render instance_segmentation_frame"
165
+ with warnings .catch_warnings ():
166
+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
167
+ assert event .class_segmentation_frame is event .semantic_segmentation_frame
168
+ assert event .semantic_segmentation_frame is not None
169
+ assert (
170
+ event .instance_segmentation_frame is not None
171
+ ), "renderObjectImage should still render instance_segmentation_frame"
165
172
166
173
167
174
def test_deprecated_segmentation_params2 ():
@@ -172,11 +179,14 @@ def test_deprecated_segmentation_params2():
172
179
renderInstanceSegmentation = True ,
173
180
)
174
181
event = controller .last_event
175
- assert event .class_segmentation_frame is event .semantic_segmentation_frame
176
- assert event .semantic_segmentation_frame is not None
177
- assert (
178
- event .instance_segmentation_frame is not None
179
- ), "renderObjectImage should still render instance_segmentation_frame"
182
+
183
+ with warnings .catch_warnings ():
184
+ warnings .simplefilter ("ignore" , category = DeprecationWarning )
185
+ assert event .class_segmentation_frame is event .semantic_segmentation_frame
186
+ assert event .semantic_segmentation_frame is not None
187
+ assert (
188
+ event .instance_segmentation_frame is not None
189
+ ), "renderObjectImage should still render instance_segmentation_frame"
180
190
181
191
182
192
def test_reset ():
0 commit comments