You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug Description
The following code says a branch condition is never false when it is.
To Reproduce
Python code to reproduce the issue (parsers.py):
import unittest
def parse_sms(text):
data = {}
for i, split in enumerate(text.split(",")):
if i == 0:
data["name"] = split.title()
print(len(data['name'].split()) == 1)
if len(data['name'].split()) == 1:
return None
continue
return data
class TestParsers(unittest.TestCase):
def test_parse_sms(self):
messages = [
"John Doe, Jane",
"Jane, John Doe",
]
for message in messages:
parse_sms(message)
Command to reproduce the issue:
python -m coverage erase
python -m coverage run --branch -m unittest parsers.py
python -m coverage html
I expected line 9 to be both True and False, but the coverage report says it is never False. The print statement on line 8 prints both False and True.
Bug Description
The following code says a branch condition is never false when it is.
To Reproduce
Python code to reproduce the issue (parsers.py):
Command to reproduce the issue:
I expected line 9 to be both True and False, but the coverage report says it is never False. The print statement on line 8 prints both False and True.
Relevant details:
The text was updated successfully, but these errors were encountered: