def testPeriodNone(self):
    """Tests that the function is never called if period == None."""
    target = tf.Variable(0)

    periodic_update = periodic_ops.periodically(
        body=lambda: target.assign_add(1).op, period=None)

    with self.test_session() as sess:
      sess.run(tf.global_variables_initializer())
      desired_value = 0
      for _ in range(1, 11):
        _, result = sess.run([periodic_update, target])
        self.assertEqual(desired_value, result)
Tests that the function is never called if period == None.
trfl/periodic_ops_test.py