File: nose2pytest.patch

package info (click to toggle)
python-mapnik 1%3A0.0~20240222-5ab32f020-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 11,364 kB
  • sloc: python: 11,685; cpp: 5,776; sh: 242; makefile: 10
file content (478 lines) | stat: -rw-r--r-- 21,735 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
Description: Use pytest instead of nose.
Author: Bas Couwenberg <sebastic@debian.org>
Bug: https://github.com/mapnik/python-mapnik/issues/282

--- a/setup.py
+++ b/setup.py
@@ -251,12 +251,11 @@ setup(
     keywords="mapnik mapbox mapping cartography",
     url="http://mapnik.org/",
     tests_require=[
-        'nose',
+        'pytest',
     ],
     package_data={
         'mapnik': ['lib/*.*', 'lib/*/*/*', 'share/*/*'],
     },
-    test_suite='nose.collector',
     cmdclass={
         'whichboost': WhichBoostCommand,
     },
--- a/test/python_tests/pgraster_test.py
+++ b/test/python_tests/pgraster_test.py
@@ -168,7 +168,7 @@ if 'pgraster' in mapnik.DatasourceCache.
                              prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['rid'], 1)
+        assert feature['rid'] == 1
         lyr = mapnik.Layer('dataraster_16bsi')
         lyr.datasource = ds
         expenv = mapnik.Box2d(-14637, 3903178, 1126863, 4859678)
@@ -183,10 +183,10 @@ if 'pgraster' in mapnik.DatasourceCache.
         pixsize = 500  # see gdalinfo dataraster.tif
         pixsize = 2497  # see gdalinfo dataraster-small.tif
         tol = pixsize * max(overview.split(',')) if overview else 0
-        assert_almost_equal(env.minx, expenv.minx)
-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
-        assert_almost_equal(env.maxy, expenv.maxy)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-7)
+        assert env.miny == pytest.approx(expenv.miny, abs=tol)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-7)
         mm = mapnik.Map(256, 256)
         style = mapnik.Style()
         col = mapnik.RasterColorizer()
@@ -209,18 +209,18 @@ if 'pgraster' in mapnik.DatasourceCache.
         lap = time.time() - t0
         log('T ' + str(lap) + ' -- ' + lbl + ' E:full')
         # no data
-        eq_(im.view(1, 1, 1, 1).tostring(), b'\x00\x00\x00\x00')
-        eq_(im.view(255, 255, 1, 1).tostring(), b'\x00\x00\x00\x00')
-        eq_(im.view(195, 116, 1, 1).tostring(), b'\x00\x00\x00\x00')
+        assert im.view(1, 1, 1, 1).tostring() == b'\x00\x00\x00\x00'
+        assert im.view(255, 255, 1, 1).tostring() == b'\x00\x00\x00\x00'
+        assert im.view(195, 116, 1, 1).tostring() == b'\x00\x00\x00\x00'
         # A0A0A0
-        eq_(im.view(100, 120, 1, 1).tostring(), b'\xa0\xa0\xa0\xff')
-        eq_(im.view(75, 80, 1, 1).tostring(), b'\xa0\xa0\xa0\xff')
+        assert im.view(100, 120, 1, 1).tostring() == b'\xa0\xa0\xa0\xff'
+        assert im.view(75, 80, 1, 1).tostring() == b'\xa0\xa0\xa0\xff'
         # 808080
-        eq_(im.view(74, 170, 1, 1).tostring(), b'\x80\x80\x80\xff')
-        eq_(im.view(30, 50, 1, 1).tostring(), b'\x80\x80\x80\xff')
+        assert im.view(74, 170, 1, 1).tostring() == b'\x80\x80\x80\xff'
+        assert im.view(30, 50, 1, 1).tostring() == b'\x80\x80\x80\xff'
         # 404040
-        eq_(im.view(190, 70, 1, 1).tostring(), b'\x40\x40\x40\xff')
-        eq_(im.view(140, 170, 1, 1).tostring(), b'\x40\x40\x40\xff')
+        assert im.view(190, 70, 1, 1).tostring() == b'\x40\x40\x40\xff'
+        assert im.view(140, 170, 1, 1).tostring() == b'\x40\x40\x40\xff'
 
         # Now zoom over a portion of the env (1/10)
         newenv = mapnik.Box2d(273663, 4024478, 330738, 4072303)
@@ -230,16 +230,16 @@ if 'pgraster' in mapnik.DatasourceCache.
         lap = time.time() - t0
         log('T ' + str(lap) + ' -- ' + lbl + ' E:1/10')
         # nodata
-        eq_(hexlify(im.view(255, 255, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(200, 254, 1, 1).tostring()), b'00000000')
+        assert hexlify(im.view(255, 255, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(200, 254, 1, 1).tostring()) == b'00000000'
         # A0A0A0
-        eq_(hexlify(im.view(90, 232, 1, 1).tostring()), b'a0a0a0ff')
-        eq_(hexlify(im.view(96, 245, 1, 1).tostring()), b'a0a0a0ff')
+        assert hexlify(im.view(90, 232, 1, 1).tostring()) == b'a0a0a0ff'
+        assert hexlify(im.view(96, 245, 1, 1).tostring()) == b'a0a0a0ff'
         # 808080
-        eq_(hexlify(im.view(1, 1, 1, 1).tostring()), b'808080ff')
-        eq_(hexlify(im.view(128, 128, 1, 1).tostring()), b'808080ff')
+        assert hexlify(im.view(1, 1, 1, 1).tostring()) == b'808080ff'
+        assert hexlify(im.view(128, 128, 1, 1).tostring()) == b'808080ff'
         # 404040
-        eq_(hexlify(im.view(255, 0, 1, 1).tostring()), b'404040ff')
+        assert hexlify(im.view(255, 0, 1, 1).tostring()) == b'404040ff'
 
     def _test_dataraster_16bsi(lbl, tilesize, constraint, overview):
         import_raster(
@@ -279,7 +279,7 @@ if 'pgraster' in mapnik.DatasourceCache.
                              prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['rid'], 1)
+        assert feature['rid'] == 1
         lyr = mapnik.Layer('rgba_8bui')
         lyr.datasource = ds
         expenv = mapnik.Box2d(0, -210, 256, 0)
@@ -293,10 +293,10 @@ if 'pgraster' in mapnik.DatasourceCache.
         # NOTE: the overview table extent only grows north and east
         pixsize = 1  # see gdalinfo river.tif
         tol = pixsize * max(overview.split(',')) if overview else 0
-        assert_almost_equal(env.minx, expenv.minx)
-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
-        assert_almost_equal(env.maxy, expenv.maxy)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-7)
+        assert env.miny == pytest.approx(expenv.miny, abs=tol)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-7)
         mm = mapnik.Map(256, 256)
         style = mapnik.Style()
         sym = mapnik.RasterSymbolizer()
@@ -316,10 +316,10 @@ if 'pgraster' in mapnik.DatasourceCache.
             lyr.name, lbl, overview, clip)
         compare_images(expected, im)
         # no data
-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(250, 250, 1, 1).tostring()), b'00000000')
+        assert hexlify(im.view(3, 3, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(250, 250, 1, 1).tostring()) == b'00000000'
         # full opaque river color
-        eq_(hexlify(im.view(175, 118, 1, 1).tostring()), b'b9d8f8ff')
+        assert hexlify(im.view(175, 118, 1, 1).tostring()) == b'b9d8f8ff'
         # half-transparent pixel
         pxstr = hexlify(im.view(122, 138, 1, 1).tostring()).decode()
         apat = ".*(..)$"
@@ -341,10 +341,10 @@ if 'pgraster' in mapnik.DatasourceCache.
             lyr.name, lbl, overview, clip)
         compare_images(expected, im)
         # no data
-        eq_(hexlify(im.view(255, 255, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(200, 40, 1, 1).tostring()), b'00000000')
+        assert hexlify(im.view(255, 255, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(200, 40, 1, 1).tostring()) == b'00000000'
         # full opaque river color
-        eq_(hexlify(im.view(100, 168, 1, 1).tostring()), b'b9d8f8ff')
+        assert hexlify(im.view(100, 168, 1, 1).tostring()) == b'b9d8f8ff'
         # half-transparent pixel
         pxstr = hexlify(im.view(122, 138, 1, 1).tostring()).decode()
         apat = ".*(..)$"
@@ -390,7 +390,7 @@ if 'pgraster' in mapnik.DatasourceCache.
                              prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['rid'], 1)
+        assert feature['rid'] == 1
         lyr = mapnik.Layer('rgba_8bui')
         lyr.datasource = ds
         expenv = mapnik.Box2d(-12329035.7652168, 4508650.39854396,
@@ -405,10 +405,10 @@ if 'pgraster' in mapnik.DatasourceCache.
         # NOTE: the overview table extent only grows north and east
         pixsize = 2  # see gdalinfo nodata-edge.tif
         tol = pixsize * max(overview.split(',')) if overview else 0
-        assert_almost_equal(env.minx, expenv.minx, places=0)
-        assert_almost_equal(env.miny, expenv.miny, delta=tol)
-        assert_almost_equal(env.maxx, expenv.maxx, delta=tol)
-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
+        assert env.miny == pytest.approx(expenv.miny, abs=tol)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=tol)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
         mm = mapnik.Map(256, 256)
         style = mapnik.Style()
         sym = mapnik.RasterSymbolizer()
@@ -428,16 +428,16 @@ if 'pgraster' in mapnik.DatasourceCache.
             lyr.name, tnam, lbl, overview, clip)
         compare_images(expected, im)
         # no data
-        eq_(hexlify(im.view(3, 16, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(128, 16, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(250, 16, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(3, 240, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(128, 240, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(250, 240, 1, 1).tostring()), b'00000000')
+        assert hexlify(im.view(3, 16, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(128, 16, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(250, 16, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(3, 240, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(128, 240, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(250, 240, 1, 1).tostring()) == b'00000000'
         # dark brown
-        eq_(hexlify(im.view(174, 39, 1, 1).tostring()), b'c3a698ff')
+        assert hexlify(im.view(174, 39, 1, 1).tostring()) == b'c3a698ff'
         # dark gray
-        eq_(hexlify(im.view(195, 132, 1, 1).tostring()), b'575f62ff')
+        assert hexlify(im.view(195, 132, 1, 1).tostring()) == b'575f62ff'
         # Now zoom over a portion of the env (1/10)
         newenv = mapnik.Box2d(-12329035.7652168, 4508926.651484220,
                               -12328997.49148983, 4508957.34625536)
@@ -451,17 +451,17 @@ if 'pgraster' in mapnik.DatasourceCache.
             lyr.name, tnam, lbl, overview, clip)
         compare_images(expected, im)
         # no data
-        eq_(hexlify(im.view(3, 16, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(128, 16, 1, 1).tostring()), b'00000000')
-        eq_(hexlify(im.view(250, 16, 1, 1).tostring()), b'00000000')
+        assert hexlify(im.view(3, 16, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(128, 16, 1, 1).tostring()) == b'00000000'
+        assert hexlify(im.view(250, 16, 1, 1).tostring()) == b'00000000'
         # black
-        eq_(hexlify(im.view(3, 42, 1, 1).tostring()), b'000000ff')
-        eq_(hexlify(im.view(3, 134, 1, 1).tostring()), b'000000ff')
-        eq_(hexlify(im.view(3, 244, 1, 1).tostring()), b'000000ff')
+        assert hexlify(im.view(3, 42, 1, 1).tostring()) == b'000000ff'
+        assert hexlify(im.view(3, 134, 1, 1).tostring()) == b'000000ff'
+        assert hexlify(im.view(3, 244, 1, 1).tostring()) == b'000000ff'
         # gray
-        eq_(hexlify(im.view(135, 157, 1, 1).tostring()), b'4e555bff')
+        assert hexlify(im.view(135, 157, 1, 1).tostring()) == b'4e555bff'
         # brown
-        eq_(hexlify(im.view(195, 223, 1, 1).tostring()), b'f2cdbaff')
+        assert hexlify(im.view(195, 223, 1, 1).tostring()) == b'f2cdbaff'
 
     def _test_rgb_8bui(lbl, tilesize, constraint, overview):
         tnam = 'nodataedge'
@@ -524,15 +524,15 @@ if 'pgraster' in mapnik.DatasourceCache.
                              prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['i'], 3)
+        assert feature['i'] == 3
         lyr = mapnik.Layer('grayscale_subquery')
         lyr.datasource = ds
         expenv = mapnik.Box2d(0, 0, 14, 14)
         env = lyr.envelope()
-        assert_almost_equal(env.minx, expenv.minx, places=0)
-        assert_almost_equal(env.miny, expenv.miny, places=0)
-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
+        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
         mm = mapnik.Map(15, 15)
         style = mapnik.Style()
         sym = mapnik.RasterSymbolizer()
@@ -560,15 +560,15 @@ if 'pgraster' in mapnik.DatasourceCache.
         h = format(val_b, '02x')
         hex_b = h + h + h + 'ff'
         hex_b = hex_b.encode()
-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(13, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(3, 8, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 8, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(13, 8, 1, 1).tostring()), hex_a)
-        eq_(hexlify(im.view(3, 13, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 13, 1, 1).tostring()), hex_b)
-        eq_(hexlify(im.view(13, 13, 1, 1).tostring()), hex_v)
+        assert hexlify(im.view(3, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(13, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(3, 8, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 8, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(13, 8, 1, 1).tostring()) == hex_a
+        assert hexlify(im.view(3, 13, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 13, 1, 1).tostring()) == hex_b
+        assert hexlify(im.view(13, 13, 1, 1).tostring()) == hex_v
 
     def test_grayscale_2bui_subquery():
         _test_grayscale_subquery('grayscale_2bui_subquery', '2BUI', 3)
@@ -637,15 +637,15 @@ if 'pgraster' in mapnik.DatasourceCache.
                              band=1, prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['i'], 3)
+        assert feature['i'] == 3
         lyr = mapnik.Layer('data_subquery')
         lyr.datasource = ds
         expenv = mapnik.Box2d(0, 0, 14, 14)
         env = lyr.envelope()
-        assert_almost_equal(env.minx, expenv.minx, places=0)
-        assert_almost_equal(env.miny, expenv.miny, places=0)
-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
+        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
         mm = mapnik.Map(15, 15)
         style = mapnik.Style()
         col = mapnik.RasterColorizer()
@@ -761,15 +761,15 @@ if 'pgraster' in mapnik.DatasourceCache.
                              prescale_rasters=rescale, clip_rasters=clip)
         fs = ds.featureset()
         feature = fs.next()
-        eq_(feature['i'], 3)
+        assert feature['i'] == 3
         lyr = mapnik.Layer('rgba_subquery')
         lyr.datasource = ds
         expenv = mapnik.Box2d(0, 0, 14, 14)
         env = lyr.envelope()
-        assert_almost_equal(env.minx, expenv.minx, places=0)
-        assert_almost_equal(env.miny, expenv.miny, places=0)
-        assert_almost_equal(env.maxx, expenv.maxx, places=0)
-        assert_almost_equal(env.maxy, expenv.maxy, places=0)
+        assert env.minx == pytest.approx(expenv.minx, abs=1e-0)
+        assert env.miny == pytest.approx(expenv.miny, abs=1e-0)
+        assert env.maxx == pytest.approx(expenv.maxx, abs=1e-0)
+        assert env.maxy == pytest.approx(expenv.maxy, abs=1e-0)
         mm = mapnik.Map(15, 15)
         style = mapnik.Style()
         sym = mapnik.RasterSymbolizer()
@@ -791,15 +791,15 @@ if 'pgraster' in mapnik.DatasourceCache.
         hex_v = format(r << 24 | g << 16 | b << 8 | a, '08x').encode()
         hex_a = format(r << 24 | g1 << 16 | b << 8 | a, '08x').encode()
         hex_b = format(r << 24 | g << 16 | b1 << 8 | a, '08x').encode()
-        eq_(hexlify(im.view(3, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(13, 3, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(3, 8, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 8, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(13, 8, 1, 1).tostring()), hex_a)
-        eq_(hexlify(im.view(3, 13, 1, 1).tostring()), hex_v)
-        eq_(hexlify(im.view(8, 13, 1, 1).tostring()), hex_b)
-        eq_(hexlify(im.view(13, 13, 1, 1).tostring()), hex_v)
+        assert hexlify(im.view(3, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(13, 3, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(3, 8, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 8, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(13, 8, 1, 1).tostring()) == hex_a
+        assert hexlify(im.view(3, 13, 1, 1).tostring()) == hex_v
+        assert hexlify(im.view(8, 13, 1, 1).tostring()) == hex_b
+        assert hexlify(im.view(13, 13, 1, 1).tostring()) == hex_v
 
     def test_rgba_8bui_subquery():
         _test_rgba_subquery(
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,7 +55,7 @@ before_install:
      sudo easy_install pip;
      export LDSHARED=$(python -c "import os;from distutils import sysconfig;print sysconfig.get_config_var('LDSHARED').replace('cc ','clang++ ')");
    fi
- - pip install --upgrade --user nose
+ - pip install --upgrade --user pytest
  - pip install --upgrade --user wheel
  - pip install --upgrade --user twine
  - pip install --upgrade --user setuptools
@@ -72,7 +72,7 @@ before_script:
  - ./mason_packages/.link/bin/postgres -k ${PGHOST} > postgres.log &
 
 script:
- - python test/run_tests.py
+ - python -m pytest -v test/
  - python test/visual.py -q
  # stop postgres
  - ./mason_packages/.link/bin/pg_ctl -w stop
--- a/test/run_tests.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-
-import getopt
-import os
-import sys
-
-
-from python_tests.utilities import TodoPlugin
-
-try:
-    import nose
-except ImportError as e:
-    sys.stderr.write(
-        "Unable to run python tests: the third party 'nose' module is required"
-        "\nTo install 'nose' do:"
-        "\n\tsudo pip install nose (or on debian systems: "
-        "apt-get install python-nose): %s\n" % e)
-    sys.exit(1)
-else:
-    from nose.plugins.doctests import Doctest
-
-
-def usage():
-    print("test.py -h | --help")
-    print("test.py [-q | -v] [-p | --prefix <path>]")
-
-
-def main():
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], "hvqp:", ["help", "prefix="])
-    except getopt.GetoptError as err:
-        print(str(err))
-        usage()
-        sys.exit(2)
-
-    prefix = None
-    verbose = False
-    quiet = False
-
-    for o, a in opts:
-        if o == "-q":
-            quiet = True
-        elif o == "-v":
-            verbose = True
-        elif o in ("-h", "--help"):
-            usage()
-            sys.exit()
-        elif o in ("-p", "--prefix"):
-            prefix = a
-        else:
-            assert False, "Unhandled option"
-
-    if quiet and verbose:
-        usage()
-        sys.exit(2)
-
-    if prefix:
-        # Allow python to find libraries for testing on the buildbot
-        sys.path.insert(
-            0,
-            os.path.join(
-                prefix,
-                "lib/python%s/site-packages" %
-                sys.version[
-                    :3]))
-
-    import mapnik
-
-    if not quiet:
-        print("- mapnik path: %s" % mapnik.__file__)
-        if hasattr(mapnik, '_mapnik'):
-            print("- _mapnik.so path: %s" % mapnik._mapnik.__file__)
-        if hasattr(mapnik, 'inputpluginspath'):
-            print("- Input plugins path: %s" % mapnik.inputpluginspath)
-        if 'MAPNIK_INPUT_PLUGINS_DIRECTORY' in os.environ:
-            print("- MAPNIK_INPUT_PLUGINS_DIRECTORY env: %s" %
-                  os.environ.get('MAPNIK_INPUT_PLUGINS_DIRECTORY'))
-        if hasattr(mapnik, 'fontscollectionpath'):
-            print("- Font path: %s" % mapnik.fontscollectionpath)
-        if 'MAPNIK_FONT_DIRECTORY' in os.environ:
-            print(
-                "- MAPNIK_FONT_DIRECTORY env: %s" %
-                os.environ.get('MAPNIK_FONT_DIRECTORY'))
-        print('')
-        print("- Running nosetests:")
-        print('')
-
-    argv = [
-        __file__,
-        '--exe',
-        '--with-todo',
-        '--with-doctest',
-        '--doctest-tests']
-
-    if not quiet:
-        argv.append('-v')
-
-    if verbose:
-        # 3 * '-v' gets us debugging information from nose
-        argv.append('-v')
-        argv.append('-v')
-
-    dirname = os.path.dirname(sys.argv[0])
-    argv.extend(['-w', os.path.join(dirname, 'python_tests')])
-
-    if not nose.run(argv=argv, plugins=[TodoPlugin(), Doctest()]):
-        sys.exit(1)
-    else:
-        sys.exit(0)
-
-if __name__ == "__main__":
-    main()
--- a/setup.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[nosetests]
-verbosity=1