Closed QuLogic closed 7 years ago
Just saw this, thanks for catching this... somehow I didn't get notified when issue created.
So I looked into this.
The problem is that supporting this would require some form of semantic analysis of the call to assert_true() to determine if it is the one from nose.tools. I am not aware of a robust way of doing this. For example, you could easily do "import nose.tools as nt" and then the script would have to look for statements of the form "nt.assert_true(...)". Plus the code might do e.g. "nt2 = nt; nt2.assert_true(...)" then the script would have to also look for "nt2.assert_true(...)".
The possiblities are endless so nose2pytest would have to actually resolve symbols to actual Python objects and test whether they are the right ones. I currently do not know how to do that, although code completion must have to do something similar so there must be a way.
In the meantime, I recommend using a search/replace, which should be really straightforward in this case. Nose2pytest could do it too but I would rather keep regexp matching out of it for now.
I have updated the Limitations section of the docs.
I'm closing this but feel free to re-open if there is something I've missed.
Take the following as an example:
When running
nose2pytest
on the above, the first test case in converted, but the fully-qualified calls (intest_case2
) are not converted.