python - Error when using 'yield' with assert_in in nose -
I am using and produce
with assert_in
.
Here is the code that causes the problem:
for lines in rows: produce assert_in, existing_name, row [self.search_field]
Error:
Failure: Value error (& lt; class; nose.tools.trivial.Dummy '& gt;: testTest has no such test method). Error =============================================== === ============================ Error: Failure: value error (no test method in runTest in 'nose.tools.trivial.Dummy' & gt; is) --- --------------------------------------------- ----- ----------------- Tracebacks (most recent Call final): File "/home/maroun/.virtualenvs/ads_management/local/lib/python2.7/site-packages/nose/loader.py", line 289, yield MethodTestCase generated (test_func, arg = arg , Descriptor = g) File "/home/maroun/.virtualenvs/ads_management/local/lib/python2.7/site-packages/nose/ Case Use", in L 345, __init__ self.inst = self.cls () file In "/usr/lib/python2.7/unittest/case.py", in line 191, __init__ (own .__ class__, methodName)) Value error: No such exams in the form & lt; Square 'nose. Toll Private. Dummy '>: runTest -------------------------------- ----------- ---------------------------
I am an inattentive, only my own Define assert_in
:
def assert_in (a, b): If not then: ber AssertionError ("% r% in% R"% (a, b)) < / Code>
For some reason, it works . What causes the problem? I think this is a nose bug, can anyone confirm?
According to:
The problem is that you can test What are you giving in the form. The "functions" in the nose are actually the bound methods of a singleton unit. You can not not make the test seasons as they are available in the form of Test Cables, because they appear due to the nose, what they are, and hence the nose to run those test cases. Tries in which they are included.
For example, if you define your own assert_true, then it will work fine:
def assert_true (arg): nt.assert_true (arg)
And instead of yielding.
This problem is only in exam sections:
Comments
Post a Comment