swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

[HW4] Question about branch coverage #134

Open tonypark7277 opened 2 years ago

tonypark7277 commented 2 years ago

When I executed coverage run --branch --source='./blog' manage.py test, I notice that branch coverage checks whether else appears after if-statement. image However I think there is nothing to do in else-statement in my code. Is it okay to just ignore it? (Those parts don't affect coverage run --source='./blog' manage.py test)

ttoru96 commented 2 years ago

I'm afraid I haven't quite understood your situation. Is it that you didn't write else block because you thought your logic does not need it?

We do check branch coverage as well, as stated in spec. So if coverage run --branch --source='./blog' manage.py test indicates that you have missed something, I recommend you to fix it.

tonypark7277 commented 2 years ago

Just changing final elif block to else block solves that problem..

Thank you for your apply!