nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 30 lines 724 B view raw
1diff --git a/test/test.py b/test/test.py 2index 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 11 12 def clear_data(): 13 try: shutil.rmtree('test/output') 14 except Exception: pass 15 16+ 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() 23+ 24+ return wrapped 25+ return wrapper 26+ 27+ 28 @with_setup(clear_data, clear_data) 29 def test_mbtiles_to_disk(): 30 mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output')