Skip to content

Commit 3e465c1

Browse files
ChristianLievenMidnighter
authored andcommitted
fix: flake8 is a cruel mistress
1 parent 17eb5c6 commit 3e465c1

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

cobra/test/test_compartment.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@
33
from __future__ import absolute_import
44

55
import pytest
6-
from cobra.core import Metabolite, Model, Reaction, Compartment
7-
6+
from cobra.core import Compartment
87

98
def test__eq__():
109
a = b = Compartment("x")
1110
c = "x"
1211
d = Compartment("x")
13-
e = Compartment ("z")
14-
assert a.__eq__(b) == True
15-
assert a.__eq__(c) == True
16-
assert a.__eq__(d) == True
17-
assert a.__eq__(e) == False
12+
e = Compartment("z")
13+
assert a.__eq__(b) is True
14+
assert a.__eq__(c) is True
15+
assert a.__eq__(d) is True
16+
assert a.__eq__(e) is False
1817

1918

2019
def test__ne__():
2120
a = b = Compartment("x")
2221
c = "x"
2322
d = Compartment("x")
24-
e = Compartment ("z")
25-
assert a.__ne__(b) == False
26-
assert a.__ne__(c) == False
27-
assert a.__ne__(d) == False
28-
assert a.__ne__(e) == True
23+
e = Compartment("z")
24+
assert a.__ne__(b) is False
25+
assert a.__ne__(c) is False
26+
assert a.__ne__(d) is False
27+
assert a.__ne__(e) is True
2928

3029

3130
def test_error_with_non_sane_id():
3231
with pytest.raises(TypeError):
33-
Compartment("Trust Me This ID Is Sane")
32+
Compartment("Trust Me This ID Is Sane")

cobra/test/test_metabolite.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
from __future__ import absolute_import
44

55
import pytest
6-
from cobra.core import Metabolite, Model, Reaction, Compartment
6+
from cobra.core import Metabolite, Model, Compartment
7+
78

89
def test_compartment_setter():
910
met = Metabolite('x', compartment=None)
1011
cytosol = Compartment('c')
1112
model = Model()
1213
model.add_compartments([cytosol])
13-
met2 =Metabolite("y")
14+
met2 = Metabolite("y")
1415
met5 = Metabolite("b")
1516
model.add_metabolites([met2, met5])
1617
met2.compartment = Compartment("c")
@@ -21,7 +22,7 @@ def test_compartment_setter():
2122
assert met.compartment is None
2223
assert met2.compartment is cytosol
2324
assert met3.compartment is cytosol
24-
assert isinstance(met4.compartment,Compartment)
25+
assert isinstance(met4.compartment, Compartment)
2526
assert met5.compartment is cytosol
2627
with pytest.raises(TypeError):
27-
Metabolite("c", compartment="Sane Compartment, Not!")
28+
Metabolite("c", compartment="Sane Compartment, Not!")

0 commit comments

Comments
 (0)