-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Append --allow-prereleases to black installation command when Poetry is used #5967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Could you take a look @DonJayamanne? :) |
Hi @notpushkin , thank you for submitting this pull request! Could you add some tests for it? Rest looks good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add tests (see comment #5967 (comment))
Thanks for a review @kimadeline! I took a look at the existing tests and I see that tests for Poetry are in a separate file and do not iterate over the Product enum (like the tests for pip / pipenv / conda), so I'm not sure where I can plug the test for the changes I've made. Could you give me a hint? :-) |
You were on the right track when you mentioned poetryInstaller.unit.test.ts. The last unit test of the suite on line 114 checks the content of the execution info array, so you could append a new test that asserts equality when the module name is test('Get executable info when installing black', async () => {
const uri = Uri.file(__dirname);
const settings = mock(PythonSettings);
when(configurationService.getSettings(uri)).thenReturn(instance(settings));
when(settings.poetryPath).thenReturn('poetry path');
const info = await poetryInstaller.getExecutionInfo('black', uri);
assert.deepEqual(info, { args: ['add', '--dev', 'black', '--allow-prereleases'], execPath: 'poetry path' });
}); |
Thank you so much @kimadeline! Added the test case and it works alright:
|
Similar to #5393.
For #5756 (it has been mistakenly closed as a duplicate of #5171, but the latter was about Pipenv and the former is about Poetry :)
Appropriate comments and documentation strings in the codeHas sufficient logging.Has telemetry for enhancements.Test plan is updated as appropriatepackage-lock.json
has been regenerated by runningnpm install
(if dependencies have changed)The wiki is updated with any design decisions/details.