def test_previtem_single(hist, monkeypatch):
 hist.start('f')
 monkeypatch.setattr(hist._tmphist, 'previtem', (lambda : 'item'))
 assert (hist.previtem() == 'item')

def test_previtem_single ( hist , monkeypatch ) : hist . start ( 'f' ) monkeypatch . setattr ( hist . _tmphist , 'previtem' , ( lambda : 'item' ) ) assert ( hist . previtem ( ) == 'item' )
test previtem() with valid input .