code: def test_int():
      c = ct.EnsureInt()
      # this should always work
      assert_equal(c(7), 7)
      assert_equal(c(7.0), 7)
      assert_equal(c("7"), 7)
      assert_equal(c([7, 3]), [7, 3])
      # this should always fail
      assert_raises(ValueError, lambda: c("fail"))
      assert_raises(ValueError, lambda: c([3, "fail"]))
      # this will also fail
      assert_raises(ValueError, lambda: c("17.0"))
      assert_equal(c.short_description(), "int")
  
file_path: datalad/datalad/tests/test_constraints.py
imports: from datalad.tests.utils_pytest import assert_equal, assert_raises
  from ..support import constraints
label_desc: Use image node_id 1 for calling a global function with example usage: test_int() without return types