Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreDecan committed Apr 12, 2021
1 parent bfe0dd2 commit b79d69d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion portion/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,3 @@ def __repr__(self):
)
)
return ' | '.join(string)

4 changes: 2 additions & 2 deletions tests/test_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def test_value(self):
assert Bound(True) == Bound.CLOSED
assert Bound(False) == Bound.OPEN

assert Bound.CLOSED.value == True
assert Bound.OPEN.value == False
assert Bound.CLOSED.value is True
assert Bound.OPEN.value is False


class TestInfinities:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_views(self):

k, v, i = d.keys(), d.values(), d.items()
assert len(k) == len(v) == len(i) == len(d)
assert list(k) == [P.closed(0, 2), P.closed(3,4)]
assert list(k) == [P.closed(0, 2), P.closed(3, 4)]
assert list(v) == [3, 2]
assert list(i) == [(P.closed(0, 2), 3), (P.closed(3, 4), 2)]

Expand All @@ -143,15 +143,15 @@ def test_issue_39(self):
assert list(d) == list([P.singleton(2), P.open(2, 3)])

def test_combine_empty(self):
add = lambda x, y: x + y
def add(x, y): return x + y
assert P.IntervalDict().combine(P.IntervalDict(), add) == P.IntervalDict()

d = P.IntervalDict([(P.closed(0, 3), 0)])
assert P.IntervalDict().combine(d, add) == d
assert d.combine(P.IntervalDict(), add) == d

def test_combine_nonempty(self):
add = lambda x, y: x + y
def add(x, y): return x + y
d1 = P.IntervalDict([(P.closed(1, 3) | P.closed(5, 7), 1)])
d2 = P.IntervalDict([(P.closed(2, 4) | P.closed(6, 8), 2)])
assert d1.combine(d2, add) == d2.combine(d1, add)
Expand Down
1 change: 0 additions & 1 deletion tests/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ def test_issue_41(self):
assert P.empty() in P.closed(0, 1) | P.closed(2, 3)



class TestIntervalIntersection:
def test_with_itself(self):
assert P.closed(0, 1) & P.closed(0, 1) == P.closed(0, 1)
Expand Down

0 comments on commit b79d69d

Please sign in to comment.