Re: Feature proposal: unittest.mock.NAN

Liste des GroupesRevenir à cl python 
Sujet : Re: Feature proposal: unittest.mock.NAN
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 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 )
 


Date Sujet#  Auteur
24 Jan 24 o Re: Feature proposal: unittest.mock.NAN1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal