Sujet : Re: Feature proposal: unittest.mock.NAN
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 24. Jan 2024, 21:34:01
Autres entêtes
Organisation : Stefan Ram
Message-ID : <math.nan-20240124213249@ram.dialup.fu-berlin.de>
References : 1
Kerrick Staley <
k@kerrickstaley.com> writes:
NaNs are special in that math.nan != math.nan, so you can't just do
assert_called_with(math.nan).
class ProductionClass:
... def method(self):
... self.something( math.nan )
... def something( self, x ):
... pass
...
real = ProductionClass()
real.something = MagicMock()
real.method()
real.something.assert_called_once_with( math.nan )