Skip to content

Commit

Permalink
Remove (incorrect) nose warnings from test_highlevel.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Aug 23, 2023
1 parent af237c3 commit a92ea74
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions python/tests/test_highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4625,7 +4625,7 @@ class TestSeekDirection:
def ts(self):
return tsutil.all_trees_ts(3)

def setup(self):
def get_tree_pair(self):
ts = self.ts()
t1 = tskit.Tree(ts)
t2 = tskit.Tree(ts)
Expand All @@ -4638,7 +4638,7 @@ def setup(self):
def test_index_from_different_directions(self, index):
# Check that we get different orderings of the children arrays
# for all trees when we go in different directions.
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
while t1.index != index:
t1.next()
while t2.index != index:
Expand All @@ -4647,7 +4647,7 @@ def test_index_from_different_directions(self, index):

@pytest.mark.parametrize("position", [0, 1, 2, 3])
def test_seek_from_null(self, position):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.clear()
t1.seek(position)
t2.first()
Expand All @@ -4656,7 +4656,7 @@ def test_seek_from_null(self, position):

@pytest.mark.parametrize("index", range(3))
def test_seek_next_tree(self, index):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
while t1.index != index:
t1.next()
t2.next()
Expand All @@ -4666,7 +4666,7 @@ def test_seek_next_tree(self, index):

@pytest.mark.parametrize("index", [3, 2, 1])
def test_seek_prev_tree(self, index):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
while t1.index != index:
t1.prev()
t2.prev()
Expand All @@ -4675,52 +4675,52 @@ def test_seek_prev_tree(self, index):
assert_trees_identical(t1, t2)

def test_seek_1_from_0(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.first()
t1.next()
t2.first()
t2.seek(1)
assert_trees_identical(t1, t2)

def test_seek_1_5_from_0(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.first()
t1.next()
t2.first()
t2.seek(1.5)
assert_trees_identical(t1, t2)

def test_seek_1_5_from_1(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
for _ in range(2):
t1.next()
t2.next()
t2.seek(1.5)
assert_trees_identical(t1, t2)

def test_seek_3_from_null(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.last()
t2.seek(3)
assert_trees_identical(t1, t2)

def test_seek_3_from_null_prev(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.last()
t1.prev()
t2.seek(3)
t2.prev()
assert_trees_identical(t1, t2)

def test_seek_3_from_0(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.last()
t2.first()
t2.seek(3)
assert_trees_identical(t1, t2)

def test_seek_0_from_3(self):
t1, t2 = self.setup()
t1, t2 = self.get_tree_pair()
t1.last()
t1.first()
t2.last()
Expand Down

0 comments on commit a92ea74

Please sign in to comment.