소스 검색

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