Fix comments and unittest for market.py and style

Trying to make the right commit to  the develop branch.
Do not break these lines with `\`. It makes the resulting code even more confusing, because it is not immediately obvious these `if`s are of the inline kind.

If you absolutely *must* break the lines, do as follows. Replace
```
VARIABLE = VALUE1 if CONDITION else VALUE2
```
with
```
if CONDITION:
    VARIABLE = VALUE1
else:
    VARIABLE = VALUE2
```