Skip to content

Commit 2c7e69a

Browse files
author
Eric Kolve
committed
tidying up pytest output; catch known warnings; don't run coverage; emit dot instead of a log message to keep travis alive
1 parent 6aaa507 commit 2c7e69a

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

ai2thor/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def image_data(self):
160160
@property
161161
def class_segmentation_frame(self):
162162
warnings.warn(
163-
"event.class_segmentation_frame has been renamed to event.semantic_segmentation_frame."
163+
"event.class_segmentation_frame has been renamed to event.semantic_segmentation_frame.", DeprecationWarning
164164
)
165165
return self.semantic_segmentation_frame
166166

ai2thor/tests/test_unity.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import random
55
import json
66
import pytest
7+
import warnings
78
import jsonschema
89
import numpy as np
910
from ai2thor.controller import Controller
@@ -32,7 +33,12 @@ class ThirdPartyCameraMetadata:
3233
def build_controller(**args):
3334
default_args = dict(scene="FloorPlan28", local_build=True)
3435
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
3642

3743

3844
wsgi_controller = build_controller(server_class=WsgiServer)
@@ -140,7 +146,6 @@ def test_small_aspect():
140146
controller.stop()
141147

142148

143-
@pytest.mark.skip(reason="temporarily skipping deprecation test")
144149
def test_bot_deprecation():
145150
controller = build_controller(agentMode="bot", width=128, height=64)
146151
assert (
@@ -157,11 +162,13 @@ def test_deprecated_segmentation_params():
157162
renderClassImage=True,
158163
)
159164
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"
165172

166173

167174
def test_deprecated_segmentation_params2():
@@ -172,11 +179,14 @@ def test_deprecated_segmentation_params2():
172179
renderInstanceSegmentation=True,
173180
)
174181
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"
180190

181191

182192
def test_reset():

pytest.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
testpaths = ai2thor/tests/
33
log_format = %(asctime)s - %(levelname)s - %(name)s - %(message)s
44
log_level = DEBUG
5-
addopts = --cov=ai2thor
65
timeout=60

tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def poll_ci_build(context):
10361036
# must emit something at least once every 10 minutes
10371037
# otherwise travis will time out the build
10381038
if (time.time() - last_emit_time) > 540:
1039-
print("Polling for build logs")
1039+
print(".", end='')
10401040
last_emit_time = time.time()
10411041

10421042
for arch in platform_map.keys():

0 commit comments

Comments
 (0)