
"""Tests for Sonnet's public API."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import importlib

import six
import sonnet as snt
from sonnet.src import test_utils
import tensorflow as tf


class PublicSymbolsTest(test_utils.TestCase):

  def test_src_not_exported(self):
    self.assertFalse(hasattr(snt, "src"))

  def test_supports_reload(self):
    mysnt = snt
    for _ in range(2):
      if six.PY2:
        mysnt = reload(mysnt)
      else:
        mysnt = importlib.reload(mysnt)
      self.assertFalse(hasattr(mysnt, "src"))

if __name__ == "__main__":
  # tf.enable_v2_behavior()
  tf.test.main()


"""Tests for Sonnet's public API."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from six.moves import reload_module as reload
import sonnet as snt
from sonnet.src import test_utils
import tensorflow as tf


class PublicSymbolsTest(test_utils.TestCase):

  def test_src_not_exported(self):
    self.assertFalse(hasattr(snt, "src"))

  def test_supports_reload(self):
    mysnt = snt
    for _ in range(2):
      mysnt = reload(mysnt)
      self.assertFalse(hasattr(mysnt, "src"))

if __name__ == "__main__":
  # tf.enable_v2_behavior()
  tf.test.main()

Use six.moves to reference `reload`.
Use six.moves to reference `reload`.

PiperOrigin-RevId: 253199825
Change-Id: Ifb9bf182572900a813ea1b0dbbda60f82495eac1

  
  """Tests for Sonnet's public API."""
  
  from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  
+ from six.moves import reload_module as reload
- import importlib
- 
- import six
  import sonnet as snt
  from sonnet.src import test_utils
  import tensorflow as tf
  
  
  class PublicSymbolsTest(test_utils.TestCase):
  
    def test_src_not_exported(self):
      self.assertFalse(hasattr(snt, "src"))
  
    def test_supports_reload(self):
      mysnt = snt
      for _ in range(2):
-       if six.PY2:
-         mysnt = reload(mysnt)
+       mysnt = reload(mysnt)
-       else:
-         mysnt = importlib.reload(mysnt)
        self.assertFalse(hasattr(mysnt, "src"))
  
  if __name__ == "__main__":
    # tf.enable_v2_behavior()
    tf.test.main()
  
Use six.moves to reference `reload`.
## Code Before:

"""Tests for Sonnet's public API."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import importlib

import six
import sonnet as snt
from sonnet.src import test_utils
import tensorflow as tf


class PublicSymbolsTest(test_utils.TestCase):

  def test_src_not_exported(self):
    self.assertFalse(hasattr(snt, "src"))

  def test_supports_reload(self):
    mysnt = snt
    for _ in range(2):
      if six.PY2:
        mysnt = reload(mysnt)
      else:
        mysnt = importlib.reload(mysnt)
      self.assertFalse(hasattr(mysnt, "src"))

if __name__ == "__main__":
  # tf.enable_v2_behavior()
  tf.test.main()

## Instruction:
Use six.moves to reference `reload`.
## Code After:

"""Tests for Sonnet's public API."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from six.moves import reload_module as reload
import sonnet as snt
from sonnet.src import test_utils
import tensorflow as tf


class PublicSymbolsTest(test_utils.TestCase):

  def test_src_not_exported(self):
    self.assertFalse(hasattr(snt, "src"))

  def test_supports_reload(self):
    mysnt = snt
    for _ in range(2):
      mysnt = reload(mysnt)
      self.assertFalse(hasattr(mysnt, "src"))

if __name__ == "__main__":
  # tf.enable_v2_behavior()
  tf.test.main()
