Kentaro Wada %!s(int64=7) %!d(string=hai) anos
pai
achega
5367e118f5
Modificáronse 3 ficheiros con 6 adicións e 6 borrados
  1. 1 0
      .gitignore
  2. 2 2
      .travis.yml
  3. 3 4
      tests/test_utils.py

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+.cache/
 build/
 build/
 dist/
 dist/
 *.py[cdo]
 *.py[cdo]

+ 2 - 2
.travis.yml

@@ -89,10 +89,10 @@ install:
   - pip install .
   - pip install .
 
 
 before_script:
 before_script:
-  - pip install -q nose
+  - pip install -q pytest
 
 
 script:
 script:
-  - nosetests tests
+  - pytest -v tests
 
 
 branches:
 branches:
   only:
   only:

+ 3 - 4
tests/test_utils.py

@@ -1,7 +1,6 @@
 import json
 import json
 import os.path as osp
 import os.path as osp
 
 
-import nose
 import numpy as np
 import numpy as np
 
 
 from labelme import utils
 from labelme import utils
@@ -11,9 +10,9 @@ here = osp.dirname(osp.abspath(__file__))
 
 
 
 
 def test_img_b64_to_array():
 def test_img_b64_to_array():
-    json_file = osp.join(here, '../static/apc2016_obj3.json')
+    json_file = osp.join(here, '../tutorial/apc2016_obj3.json')
     data = json.load(open(json_file))
     data = json.load(open(json_file))
     img_b64 = data['imageData']
     img_b64 = data['imageData']
     img = utils.img_b64_to_array(img_b64)
     img = utils.img_b64_to_array(img_b64)
-    nose.tools.assert_equal(img.dtype, np.uint8)
-    nose.tools.assert_equal(img.shape, (907, 1210, 3))
+    assert img.dtype == np.uint8
+    assert img.shape == (907, 1210, 3)