Categories

Jul 14 in Python
Q: What are Usage of OK_ and EQ_ in NOSE Python?

1 Answer

Jul 14
nose.tools also contain methods ok_ and eq_, which function similar to assert and assert_equals respectively.

You can optionally pass an error message that can be displayed when a test fails.

Usage of ok_ and eq_ is shown in below example by defining two functions in sample_test_module.py

from nose.tools import ok_, eq_

def test_using_ok():

    ok_(2+3==5)

def test_using_eq():

    eq_(2+3, 5)
Click here to read more about Python
Click here to read more about Insurance

Related questions

Madanswer
Jul 14 in Python
Jul 16 in Python
Jul 2 in Python
...