docstr: Tests scalar v2 invocation when global step is not set.
docstr_tok: ["Tests","scalar","v2","invocation","when","global","step","is","not","set","."]
code: def test_scalar_summary_v2__global_step_not_set(self):
      """Tests scalar v2 invocation when global step is not set."""
      with self.assertWarnsRegex(UserWarning, "global step not set"):
          with test.mock.patch.object(
              summary_v2, "scalar", autospec=True
          ) as mock_scalar_v2:
              with summary_ops_v2.create_summary_file_writer(
                  self.get_temp_dir()
              ).as_default():
                  summary_lib.scalar("float", constant_op.constant(2.5))
      mock_scalar_v2.assert_not_called()
  
imports: from tensorboard.summary import v2
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import summary_ops_v2
  from tensorflow.python.platform import test
  from tensorflow.python.summary import summary
  from tensorflow.python.training import training_util
label_desc: Use image node_id 3 for calling the SummaryV2Test obj's underlying member method code with example usage: obj.test_scalar_summary_v2__global_step_not_set() without return types