pytest-dev / nose2pytest

Scripts to convert Python Nose tests to PyTest
Other
38 stars 12 forks source link

No failure if dir doesnt exist #12

Closed jayvdb closed 1 year ago

jayvdb commented 4 years ago

If the directory given in the arguments does not exist, the program should have a non-zero exit status.

PhilippSelenium commented 3 years ago

Looking at the code this seems to be an issue of lib2to3:

In https://github.com/pytest-dev/nose2pytest/blob/b5f76c57aee837c7c84a4787efd5daa310183cf4/nose2pytest/script.py#L595 the directory name is directly passed to NoseConversionRefactoringTool which inherits from lib2to3refactor.MultiprocessRefactoringTool

But of course it could also be hacked in here.

jayvdb commented 3 years ago

I guess we can check args.dir_name before passing it to lib2to3