@@ -259,15 +259,15 @@ def test_reader_url():
259
259
with shapefile .Reader (url ) as sf :
260
260
for recShape in sf .iterShapeRecords ():
261
261
pass
262
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
262
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
263
263
264
264
# test without extension
265
265
url = "https://github.com/nvkelso/natural-earth-vector/blob/master/110m_cultural/ne_110m_admin_0_tiny_countries?raw=true"
266
266
with shapefile .Reader (url ) as sf :
267
267
for recShape in sf .iterShapeRecords ():
268
268
pass
269
269
assert len (sf ) > 0
270
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
270
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
271
271
272
272
# test no files found
273
273
url = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/README.md"
@@ -281,7 +281,7 @@ def test_reader_url():
281
281
for recShape in sf .iterShapeRecords ():
282
282
pass
283
283
assert len (sf ) > 0
284
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
284
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
285
285
286
286
287
287
def test_reader_zip ():
@@ -293,7 +293,7 @@ def test_reader_zip():
293
293
for recShape in sf .iterShapeRecords ():
294
294
pass
295
295
assert len (sf ) > 0
296
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
296
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
297
297
298
298
# test require specific path when reading multi-shapefile zipfile
299
299
with pytest .raises (shapefile .ShapefileException ):
@@ -305,14 +305,14 @@ def test_reader_zip():
305
305
for recShape in sf .iterShapeRecords ():
306
306
pass
307
307
assert len (sf ) > 0
308
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
308
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
309
309
310
310
# test specifying the path when reading multi-shapefile zipfile (without extension)
311
311
with shapefile .Reader ("shapefiles/blockgroups_multishapefile.zip/blockgroups2" ) as sf :
312
312
for recShape in sf .iterShapeRecords ():
313
313
pass
314
314
assert len (sf ) > 0
315
- assert sf .shp .closed == sf .shx .closed == sf .dbf .closed == True
315
+ assert sf .shp .closed == sf .shx .closed == sf .dbf .closed is True
316
316
317
317
# test raising error when can't find shapefile inside zipfile
318
318
with pytest .raises (shapefile .ShapefileException ):
@@ -1150,7 +1150,7 @@ def test_write_shp_only(tmpdir):
1150
1150
assert writer .shp and not writer .shx and not writer .dbf
1151
1151
assert writer .shpNum == 1
1152
1152
assert len (writer ) == 1
1153
- assert writer .shp .closed == True
1153
+ assert writer .shp .closed is True
1154
1154
1155
1155
# assert test.shp exists
1156
1156
assert os .path .exists (filename + '.shp' )
@@ -1180,7 +1180,7 @@ def test_write_shp_shx_only(tmpdir):
1180
1180
assert writer .shp and writer .shx and not writer .dbf
1181
1181
assert writer .shpNum == 1
1182
1182
assert len (writer ) == 1
1183
- assert writer .shp .closed == writer .shx .closed == True
1183
+ assert writer .shp .closed == writer .shx .closed is True
1184
1184
1185
1185
# assert test.shp exists
1186
1186
assert os .path .exists (filename + '.shp' )
@@ -1214,7 +1214,7 @@ def test_write_shp_dbf_only(tmpdir):
1214
1214
assert writer .shp and not writer .shx and writer .dbf
1215
1215
assert writer .shpNum == writer .recNum == 1
1216
1216
assert len (writer ) == 1
1217
- assert writer .shp .closed == writer .dbf .closed == True
1217
+ assert writer .shp .closed == writer .dbf .closed is True
1218
1218
1219
1219
# assert test.shp exists
1220
1220
assert os .path .exists (filename + '.shp' )
@@ -1246,7 +1246,7 @@ def test_write_dbf_only(tmpdir):
1246
1246
assert not writer .shp and not writer .shx and writer .dbf
1247
1247
assert writer .recNum == 1
1248
1248
assert len (writer ) == 1
1249
- assert writer .dbf .closed == True
1249
+ assert writer .dbf .closed is True
1250
1250
1251
1251
# assert test.dbf exists
1252
1252
assert os .path .exists (filename + '.dbf' )
0 commit comments