瀏覽代碼

fix tests

Daniel Wallace 6 年之前
父節點
當前提交
2b6772f245
共有 2 個文件被更改,包括 5 次插入12 次删除
  1. 4 0
      pepper/__init__.py
  2. 1 12
      tests/unit/test_init.py

+ 4 - 0
pepper/__init__.py

@@ -12,3 +12,7 @@ try:
 except pkg_resources.DistributionNotFound:
     # package is not installed
     __version__ = None
+
+# For backwards compatibility
+version = __version__
+sha = None

+ 1 - 12
tests/unit/test_init.py

@@ -24,15 +24,4 @@ def test_version():
     version = b'.'.join([version[0], b'dev' + version[1]]).decode()
     sha = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode()
     assert pepper.version == version
-    assert pepper.sha == sha
-
-
-def test_version_json():
-    vfile = os.path.join(os.path.dirname(pepper.__file__), 'version.json')
-    with open(vfile, 'w') as vfh:
-        print('{"version": "9999.99.9", "sha": "abc123"}', file=vfh)
-
-    ptest = imp.load_source('ptest', os.path.join(os.path.dirname(pepper.__file__), '__init__.py'))
-    os.remove(vfile)
-    assert ptest.version == '9999.99.9'
-    assert ptest.sha == 'abc123'
+    assert ptest.sha is None