MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_hash_method_nan

Method test_hash_method_nan

Lib/test/test_decimal.py:1993–2004  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1991 self.assertEqual(hashit(Decimal(x)), hashit(x))
1992
1993 def test_hash_method_nan(self):
1994 Decimal = self.decimal.Decimal
1995 self.assertRaises(TypeError, hash, Decimal('sNaN'))
1996 value = Decimal('NaN')
1997 self.assertEqual(hash(value), object.__hash__(value))
1998 class H:
1999 def __hash__(self):
2000 return 42
2001 class D(Decimal, H):
2002 pass
2003 value = D('NaN')
2004 self.assertEqual(hash(value), object.__hash__(value))
2005
2006 def test_min_and_max_methods(self):
2007 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 6

DecimalClass · 0.85
hashFunction · 0.85
DClass · 0.70
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
__hash__Method · 0.45

Tested by

no test coverage detected