forked from zoeyuchao/habitat-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_demo_notebook.py
29 lines (22 loc) · 932 Bytes
/
test_demo_notebook.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import gc
import pytest
import habitat
from habitat.datasets.pointnav.pointnav_dataset import PointNavDatasetV1
def test_demo_notebook():
config = habitat.get_config("configs/tasks/pointnav_mp3d.yaml")
config.defrost()
config.DATASET.SPLIT = "val"
if not PointNavDatasetV1.check_config_paths_exist(config.DATASET):
pytest.skip(
"Please download the Matterport3D PointNav val dataset and Matterport3D val scenes"
)
else:
pytest.main(["--nbval-lax", "notebooks/habitat-api-demo.ipynb"])
# NB: Force a gc collect run as it can take a little bit for
# the cleanup to happen after the notebook and we get
# a double context crash!
gc.collect()