neotest-python icon indicating copy to clipboard operation
neotest-python copied to clipboard

Add support for nose2

Open valentingregoire opened this issue 2 years ago • 3 comments

Nose2 is also a test runner. It would be cool if that would be supported as well.

valentingregoire avatar Oct 20 '22 19:10 valentingregoire

Happy to add support but I've never used nose2 so I have idea on what's required and can't say it'll be a priority. I'd be happy to help anyone who wishes to contribute though!

rcarriga avatar Oct 25 '22 08:10 rcarriga

I am trying to implement it myself, but I'm having a hard time understanding the code so far. I'll see if I find time to complete it.

valentingregoire avatar Oct 28 '22 20:10 valentingregoire

The main thing needed is a runner adapter class in the python code which will be added to this function https://github.com/rcarriga/neotest-python/blob/9e2db9375c02aa2b7fe1e7017d233ec2de20ee58/neotest_python/init.py#L14

The class just needs to implement a run method which will take the list of arguments for the runner and a callback for streamed results (I wouldn't worry about streaming for the initial implementation). It should return a dict of position IDs to result dicts, you can see typeddict definitions for the results here https://github.com/rcarriga/neotest-python/blob/9e2db9375c02aa2b7fe1e7017d233ec2de20ee58/neotest_python/base.py#L18-L25

Depending on how similar nose is to pytest/unittest for how tests are structured that should be all that's needed, apart from updating docs :smile:

rcarriga avatar Oct 29 '22 09:10 rcarriga