GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

Remove unittest code from non-test code

Open mwatts15 opened this issue 7 years ago • 1 comments

I see these imports of unittest in

  • https://github.com/gitpython-developers/GitPython/blob/a8591a094a768d73e6efb5a698f74d354c989291/git/objects/submodule/base.py#L6
  • https://github.com/gitpython-developers/GitPython/blob/f3265bd8beb017890699d093586126ff8af4a3fe/git/util.py#L17

I generally think that test code should not be built into the business logic. Is there a reason why using a skipIf decorator is insufficient?

mwatts15 avatar Aug 23 '18 02:08 mwatts15

Good catch, I absolutely agree! Even though I am pretty sure there was a very good reason to do that at some point in time. With the current state of windows test, for which these dependencies seemingly have been introduced. Maybe @ankostis can provide more context, who did magnificent work a while ago to get windows back into shape.

Byron avatar Oct 14 '18 10:10 Byron