Skip to content

Commit 43db3c9

Browse files
committed
fix test issue that count variable unexpectedly overwritten
1 parent 6d3ca80 commit 43db3c9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

atwiki/test/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def test_get_list(self):
7878
text = soup.find('div', class_='pagelist').text
7979
m = re.search(r'計 (\d+) ページ / 1 から 100 を表示', text)
8080
assert m is not None
81-
count = int(m.group(1))
82-
assert 45000 < count < 90000
83-
last_index = math.ceil(count / 100)
81+
total_count = int(m.group(1)) # Total number of pages
82+
assert 45000 < total_count < 90000
83+
last_index = math.ceil(total_count / 100)
8484

8585
# Ensure listing pagerize works. (retrieve 3 listing, 100 pages in each)
8686
count = 0
@@ -94,7 +94,7 @@ def test_get_list(self):
9494
# Get list from the last listing.
9595
# N.B. The page counter is not updated immediately.
9696
pages = list(self._api.get_list(_start=last_index))
97-
expected = (count % 100)
97+
expected = (total_count % 100)
9898
assert max(0, (expected - 50)) < len(pages) < min(100, (expected + 50))
9999

100100
# Get out-of-bounds listing. (expected to wrap around)

0 commit comments

Comments
 (0)