mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
implement coverage tool for function 2
This commit is contained in:
parent
90eeb9c8f6
commit
4a9514774a
@ -12,6 +12,11 @@ from .logs import warn, exception
|
||||
from .conf import settings
|
||||
from .system import Path
|
||||
|
||||
branch_coverage = {
|
||||
"branch_1" : False,
|
||||
"branch_2" : False
|
||||
}
|
||||
|
||||
DEVNULL = open(os.devnull, 'w')
|
||||
|
||||
if six.PY2:
|
||||
@ -296,15 +301,16 @@ cache.disabled = False
|
||||
|
||||
def get_installation_version():
|
||||
try:
|
||||
branch_coverage['branch_1'] = True
|
||||
from importlib.metadata import version
|
||||
|
||||
return version('thefuck')
|
||||
except ImportError:
|
||||
branch_coverage["branch_2"] = True
|
||||
import pkg_resources
|
||||
|
||||
return pkg_resources.require('thefuck')[0].version
|
||||
|
||||
|
||||
def get_alias():
|
||||
return os.environ.get('TF_ALIAS', 'fuck')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user