code: def test_scalar_promotion(self):
      for sc1, sc2 in product(scalar_instances(), scalar_instances()):
          sc1, sc2 = sc1.values[0], sc2.values[0]
          # test all combinations:
          try:
              arr = np.array([sc1, sc2])
          except (TypeError, ValueError):
              # The promotion between two times can fail
              # XFAIL (ValueError): Some object casts are currently undefined
              continue
          assert arr.shape == (2,)
          try:
              dt1, dt2 = sc1.dtype, sc2.dtype
              expected_dtype = np.promote_types(dt1, dt2)
              assert arr.dtype == expected_dtype
          except TypeError as e:
              # Will currently always go to object dtype
              assert arr.dtype == np.dtype("O")
  
imports: from itertools import permutations, product
  import pytest
  from pytest import param
  import numpy
  from numpy.core._rational_tests import rational
  from numpy.core._multiarray_umath import _discover_array_parameters
  from numpy.testing import assert_array_equal, assert_warns, IS_PYPY
label_desc: Use image node_id 6 for calling the TestScalarDiscovery obj's underlying member method code with example usage: obj.test_scalar_promotion() without return types