0 votes
in Python by
What are Usage of OK_ and EQ_ in NOSE Python?

1 Answer

0 votes
by
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)

Related questions

0 votes
asked Jul 2, 2020 in Python by GeorgeBell
+1 vote
asked Jul 16, 2020 in Python by GeorgeBell
...