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

1 Answer

0 votes
Jul 14, 2020
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():


def test_using_eq():

    eq_(2+3, 5)

Related questions

0 votes
Jul 14, 2020 in Python
+1 vote
Jul 16, 2020 in Python