mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +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 .conf import settings
|
||||||
from .system import Path
|
from .system import Path
|
||||||
|
|
||||||
|
branch_coverage = {
|
||||||
|
"branch_1" : False,
|
||||||
|
"branch_2" : False
|
||||||
|
}
|
||||||
|
|
||||||
DEVNULL = open(os.devnull, 'w')
|
DEVNULL = open(os.devnull, 'w')
|
||||||
|
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
@ -296,15 +301,16 @@ cache.disabled = False
|
|||||||
|
|
||||||
def get_installation_version():
|
def get_installation_version():
|
||||||
try:
|
try:
|
||||||
|
branch_coverage['branch_1'] = True
|
||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
|
|
||||||
return version('thefuck')
|
return version('thefuck')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
branch_coverage["branch_2"] = True
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
return pkg_resources.require('thefuck')[0].version
|
return pkg_resources.require('thefuck')[0].version
|
||||||
|
|
||||||
|
|
||||||
def get_alias():
|
def get_alias():
|
||||||
return os.environ.get('TF_ALIAS', 'fuck')
|
return os.environ.get('TF_ALIAS', 'fuck')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user