Daniel Wallace 6 yıl önce
ebeveyn
işleme
2b6772f245
2 değiştirilmiş dosya ile 5 ekleme ve 12 silme
  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