Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit ae49192

Browse files
author
Ryan Sepassi
committed
fix some open-source imports
PiperOrigin-RevId: 164776330
1 parent 4a36fb8 commit ae49192

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tensor2tensor/data_generators/desc2code_test.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
"""Tests for google3.third_party.py.tensor2tensor.data_generators.desc2code."""
16+
"""Tests for desc2code."""
1717

1818
from __future__ import absolute_import
1919
from __future__ import division
2020
from __future__ import print_function
2121

2222
# Dependency imports
2323
from tensor2tensor.data_generators import desc2code
24-
from google3.testing.pybase import googletest
2524

25+
import tensorflow as tf
2626

2727
CODE_CPP_IN = """
2828
#include <iostream>
@@ -39,26 +39,25 @@
3939
4040
"""
4141

42-
CODE_CPP_OUT = "#include <iostream> void main() { /* Not this one */ int a = 3; }" # pylint: disable=line-too-loong
42+
CODE_CPP_OUT = ("#include <iostream> void main() { /* Not this one */ int a = "
43+
"3; }")
4344

4445

45-
class Desc2codeTest(googletest.TestCase):
46+
class Desc2codeTest(tf.test.TestCase):
4647

4748
def testCppPreprocess(self):
4849
"""Check that the file correctly preprocess the code source."""
4950
cpp_pb = desc2code.Desc2CodeCppProblem()
5051

5152
self.assertEqual( # Add space beween two lines
5253
cpp_pb.preprocess_target("firstline//comm1\nsecondline//comm2\n"),
53-
"firstline secondline"
54-
)
54+
"firstline secondline")
5555
# Checking for boths comments and spaces
5656
self.assertEqual(cpp_pb.preprocess_target(CODE_CPP_IN), CODE_CPP_OUT)
5757
self.assertEqual(
5858
cpp_pb.preprocess_target(" not removed //abcd "),
59-
"not removed //abcd"
60-
)
59+
"not removed //abcd")
6160

6261

6362
if __name__ == "__main__":
64-
googletest.main()
63+
tf.test.main()

0 commit comments

Comments
 (0)