anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / misc / mbutil / migrate_to_pytest.patch
blobdd47f777b928c227313383f8c7f9d68a558aa6f0
1 diff --git a/test/test.py b/test/test.py
2 index e02e259..1452fda 100644
3 --- a/test/test.py
4 +++ b/test/test.py
5 @@ -1,13 +1,24 @@
6 import os, shutil
7 import sys
8 import json
9 -from nose import with_setup
10 from mbutil import mbtiles_to_disk, disk_to_mbtiles
12 def clear_data():
13 try: shutil.rmtree('test/output')
14 except Exception: pass
17 +def with_setup(setup_func, teardown_func):
18 + def wrapper(func):
19 + def wrapped(*args, **kwargs):
20 + setup_func()
21 + func(*args, **kwargs)
22 + teardown_func()
24 + return wrapped
25 + return wrapper
28 @with_setup(clear_data, clear_data)
29 def test_mbtiles_to_disk():
30 mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output')