Skip to content

Commit

Permalink
build: use tf.test.main for mesh:demo_utils_test (#2319)
Browse files Browse the repository at this point in the history
Summary:
This test case already contains actual TensorFlow code, via the `GFile`
use in the code under test. Within Google, such tests must be run via
`tf.test.main()` or `absltest.main()`, and the TensorFlow-specific code
should be in a `tf.test.TestCase` as well (though this is not strictly
required).

Test Plan:
Verified that this patch fixes a test that’s broken when syncing into
Google3.

wchargin-branch: tf-test-mesh-test
  • Loading branch information
wchargin authored Jun 6, 2019
1 parent b549bfd commit 1bb320d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions tensorboard/plugins/mesh/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ py_test(
srcs = ["demo_utils_test.py"],
data = [
":test_data",
"//tensorboard/compat:tensorflow",
],
srcs_version = "PY2AND3",
deps = [
Expand Down
7 changes: 5 additions & 2 deletions tensorboard/plugins/mesh/demo_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@

import os
import unittest

import tensorflow as tf

from tensorboard.plugins.mesh import demo_utils


class TestPLYReader(unittest.TestCase):
class TestPLYReader(tf.test.TestCase):
def test_parse_vertex(self):
"""Tests vertex coordinate and color parsing."""
# Vertex 3D coordinates with RGBA color.
Expand Down Expand Up @@ -56,4 +59,4 @@ def test_read_ascii_ply(self):


if __name__ == '__main__':
unittest.main()
tf.test.main()

0 comments on commit 1bb320d

Please sign in to comment.