So there's 2 thoughts of how to solve this: (Still referencing lines 159 and 172)
1) Account for all permutations of the bits that will be flagged for the test failures we want to ignore (0, 4, 64, and 68)
In which case the code would need to be: if (proc.returncode != 0 and proc.returncode != 4 and proc.returncode != 64 and proc.returncode != 68):
and
return (0 if proc.returncode == 4 or proc.returncode == 64 or proc.returncode == 68 else proc.returncode)
2) Completely ignore those flags occurring with a bitwise operation that can mask it completely from those bits being flagged
In which case the code could be: if (proc.returncode & 187) != 0:
return 0 if (proc.returncode & 187) == 0 else proc.returncode
And you might even be able to shorten line 172 to just the below, and remove the if/else completely: return (proc.returncode & 187)
Not sure how dev's find it best to handle it, but wanted to throw out a more completely solution.
So there's 2 thoughts of how to solve this:
(Still referencing lines 159 and 172)
1) Account for all permutations of the bits that will be flagged for the test failures we want to ignore (0, 4, 64, and 68)
In which case the code would need to be:
if (proc.returncode != 0 and proc.returncode != 4 and proc.returncode != 64 and proc.returncode != 68):
and
return (0 if proc.returncode == 4 or proc.returncode == 64 or proc.returncode == 68 else proc.returncode)
2) Completely ignore those flags occurring with a bitwise operation that can mask it completely from those bits being flagged
In which case the code could be:
if (proc.returncode & 187) != 0:
and
return 0 if (proc.returncode & 187) == 0 else proc.returncode
And you might even be able to shorten line 172 to just the below, and remove the if/else completely:
return (proc.returncode & 187)
Not sure how dev's find it best to handle it, but wanted to throw out a more completely solution.