-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
special-case
--prompt .
to the cwd (#2220)
Co-authored-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
4188ac6
commit 6bfc29e
Showing
5 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Special-case ``--prompt .`` to the name of the current directory - by :user:`rkm`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from argparse import Namespace | ||
|
||
from virtualenv.activation.activator import Activator | ||
|
||
|
||
def test_activator_prompt_cwd(monkeypatch, tmp_path): | ||
class FakeActivator(Activator): | ||
def generate(self, creator): | ||
raise NotImplementedError | ||
|
||
cwd = tmp_path / "magic" | ||
cwd.mkdir() | ||
monkeypatch.chdir(cwd) | ||
|
||
activator = FakeActivator(Namespace(prompt=".")) | ||
assert activator.flag_prompt == "magic" |