Repository navigation
Conversation
Also add some initial sanity-check tests for the env tmpdir
Prompt suppression for bash. Probably should be changed to write/read the $PS1 from a temp file. DEFINITELY needs to be skipped if on Windows.
Closes pypa#1294.
Also add docstrings.
MacOS doesn't provide 'dir', seems.
|
@bskinn activator script tests are here https://github.com/pypa/virtualenv/blob/master/tests/activation/test_activation.py, any reason why this needs to be separate? I would prefer to extend that rather than create a new place for such tests. |
|
Mm, no, you're right - that's a much better place to put these. Should enable me to take advantage of the tooling for working with the other shells, too. (I had started them out in a new module so that I'd have less chance of colliding with other PRs to |
|
It's here https://github.com/bskinn/virtualenv/blob/d5fed2304992a85b378e31b5cf26ce957b324976/tests/activation/test_activation.py#L90, would prefer per feature. Once you add test for one feature, you'll need to fix issues for all interpreters. This ensures our feature parity is uniform. |
|
Hm... can you restate/clarify? I'm not sure what you're asking for. Right now my testing strategy is to activate/deactivate the environment in a If there's a different way you'd prefer me to go about it, I can reimplement... if I understand you correctly, though, you're suggesting inspecting the activate scripts themselves, rather than their effects on the prompt... and the syntaces of the various shells are different enough that it seems like that introspection would be difficult to implement in a single (parametrized?) test. |
|
The way we test the activation scripts is already to create an env and then generate various commands: - see https://github.com/bskinn/virtualenv/blob/d5fed2304992a85b378e31b5cf26ce957b324976/tests/activation/test_activation.py#L92, your prompt tests should be part of this, e.g. by printing PS1, probably through python 👍 And then make asserts on that line 👍 |
|
Ok, gotcha -- I'll give it a go, trying to integrate them there. Few things:
|
you'll need to be specific, what oddities we need to pick from exactly?
we could though add a test parameter to be with or without though 👍
Each shells have their own activations scripts, etc too. The environment variable would be an argument on these classes, see https://github.com/bskinn/virtualenv/blob/d5fed2304992a85b378e31b5cf26ce957b324976/tests/activation/test_activation.py#L181
Let's talk concretes so we can plan accordingly. |
Do you want to discuss xonsh here, or under #1299? |
|
Have an idea for handling xonsh. No need to discuss for now. |
|
@gaborbernat I don't think I'm going to be able to get these tests to work by integrating them into the existing The biggest problem is that the FWIW, I'm pretty sure it's an additional problem that the TBH, in exploring the behavior of Anyways, I now have a rough-draft (lots of refactoring needed) unified, cross-shell framework put together for these prompt behavior tests, here. I believe it accurately reflects the state of the activation scripts as laid out in the tracking project on my fork. What do you think? |
|
I think the first paragraph issues you enlist problems are solvable. That being said having it separate for now is still an improvement, let's put it under activation/test_prompts.py. My biggest issue with having it separate is overhead on running the CI time wise. It already takes 13 minutes to run Jython, creating new venvs will only increase that even more. That being said we can improve on time later. Feel free to make that PR. |
|
Wouldn't surprise me if there is a way to fully integrate them -- I just don't think I'm going to be able to figure it out. I'll relocate the test module, and I should be able to piggyback the non- But, I think creating a second venv for the |
THIS PR WAS OBSOLETED BY #1330.
Adds the tests called for in #1294. No changes to API/features. Ping @gaborbernat for review.
No changes yet to documentation; no news item added yet -- I would think neither is necessary for this, though?
Let me know if I should squash-rebase.
docs/changelogfolder (???)