mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
open cli command logic update
This commit is contained in:
@@ -569,7 +569,10 @@ def run_open(state, module, *args, **kwargs):
|
||||
else:
|
||||
p = c.out.strip().rstrip("cdo")
|
||||
echo(crayons.normal("Opening {0!r} in your EDITOR.".format(p), bold=True))
|
||||
edit(filename=p)
|
||||
from ..core import inline_activate_virtual_environment
|
||||
inline_activate_virtual_environment()
|
||||
environment={"VIRTUAL_ENV":os.environ["VIRTUAL_ENV"]}
|
||||
edit(filename=p, env=environment)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +125,12 @@ def test_pipenv_check(PipenvInstance, pypi):
|
||||
assert 'Ignoring' in c.err
|
||||
|
||||
|
||||
@pytest.mark.cli
|
||||
def test_pipenv_open(PipenvInstance, pypi):
|
||||
with PipenvInstance(pypi=pypi) as p:
|
||||
assert p.pipenv("open test").out
|
||||
|
||||
|
||||
@pytest.mark.cli
|
||||
def test_pipenv_clean_pip_no_warnings(PipenvInstance):
|
||||
with PipenvInstance(chdir=True) as p:
|
||||
|
||||
Reference in New Issue
Block a user