Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 25a3199

Browse filesBrowse files
committed
Test default values. Pass in correct stop value.
1 parent 3f5641b commit 25a3199
Copy full SHA for 25a3199

File tree

Expand file treeCollapse file tree

1 file changed

+12
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-5
lines changed

‎test_shapefile.py

Copy file name to clipboardExpand all lines: test_shapefile.py
+12-5Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,9 @@ def test_iterRecords_start_stop():
983983
with shapefile.Reader("shapefiles/blockgroups") as sf:
984984
N = len(sf)
985985

986-
# Arbitrary selection of start values
987-
for start in [
986+
# Arbitrary selection of record indices
987+
# (there are 663 records in blockgroups.dbf).
988+
for i in [
988989
0,
989990
1,
990991
2,
@@ -1003,11 +1004,17 @@ def test_iterRecords_start_stop():
10031004
N - 2,
10041005
N - 1,
10051006
]:
1006-
for stop in range(start, len(sf)):
1007+
for record in sf.iterRecords(start=i):
1008+
assert record == sf.record(record.oid)
1009+
1010+
for record in sf.iterRecords(stop=i):
1011+
assert record == sf.record(record.oid)
1012+
1013+
for stop in range(i, len(sf)):
10071014
# test negative indexing from end, as well as
10081015
# positive values of stop, and its default
1009-
for stop_arg in (stop, stop - len(sf), None):
1010-
for record in sf.iterRecords(start=start, stop=stop):
1016+
for stop_arg in (stop, stop - len(sf)):
1017+
for record in sf.iterRecords(start=i, stop=stop_arg):
10111018
assert record == sf.record(record.oid)
10121019

10131020

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.