From 9e8d91ebf91bc91f2e00d97a0bcc7009f142bafa Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Mon, 19 Jul 2021 05:43:07 -0700 Subject: [PATCH] restore build tests Summary: A bad env var check meant these tests were not being run. Fix that, and fix the copyright test for the new message format. Reviewed By: patricklabatut Differential Revision: D29734562 fbshipit-source-id: a1a9bb68901b09c71c7b4ff81a04083febca8d50 --- pytorch3d/vis/plotly_vis.py | 2 +- test.py | 0 tests/test_build.py | 9 +++------ 3 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 test.py diff --git a/pytorch3d/vis/plotly_vis.py b/pytorch3d/vis/plotly_vis.py index 9e29aa1c..20468767 100644 --- a/pytorch3d/vis/plotly_vis.py +++ b/pytorch3d/vis/plotly_vis.py @@ -11,7 +11,7 @@ import numpy as np import plotly.graph_objects as go import torch from plotly.subplots import make_subplots -from pytorch3d.renderer import TexturesVertex, RayBundle, ray_bundle_to_ray_points +from pytorch3d.renderer import RayBundle, TexturesVertex, ray_bundle_to_ray_points from pytorch3d.renderer.camera_utils import camera_to_eye_at_up from pytorch3d.renderer.cameras import CamerasBase from pytorch3d.structures import Meshes, Pointclouds, join_meshes_as_scene diff --git a/test.py b/test.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/test_build.py b/tests/test_build.py index 61cc777e..8cfd4b66 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -15,7 +15,7 @@ from common_testing import get_pytorch3d_dir, get_tests_dir # This file groups together tests which look at the code without running it. # When running the tests inside conda's build, the code is not available. in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST" -in_re_worker = os.environ.get("INSIDE_RE_WORKER", "") is not None +in_re_worker = os.environ.get("INSIDE_RE_WORKER") is not None class TestBuild(unittest.TestCase): @@ -42,10 +42,7 @@ class TestBuild(unittest.TestCase): extensions = ("py", "cu", "cuh", "cpp", "h", "hpp", "sh") - expect = ( - "Copyright (c) Facebook, Inc. and its affiliates." - + " All rights reserved.\n" - ) + expect = "Copyright (c) Facebook, Inc. and its affiliates.\n" files_missing_copyright_header = [] @@ -59,7 +56,7 @@ class TestBuild(unittest.TestCase): continue with open(path) as f: firstline = f.readline() - if firstline.startswith(("# -*-", "#!")): + if firstline.startswith(("# -*-", "#!", "/*")): firstline = f.readline() if not firstline.endswith(expect): files_missing_copyright_header.append(str(path))