Skip to content

chore: remove pytest-console-scripts specific config #1714

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

Merged
merged 1 commit into from
Nov 27, 2021

Conversation

JohnVillalovos
Copy link
Member

Remove the pytest-console-scripts specific config from the global
'[pytest]' config section.

Move it to a command line option for the functional tests which use
the Docker container.

Closes #1713

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/pytest_script_launch_mode branch from 2a71da0 to a2f7996 Compare November 25, 2021 21:08
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JohnVillalovos just a quick note :)

@JohnVillalovos JohnVillalovos marked this pull request as draft November 25, 2021 21:32
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/pytest_script_launch_mode branch 5 times, most recently from 0546f66 to 2ef0b5b Compare November 25, 2021 21:59
@JohnVillalovos
Copy link
Member Author

@nejch Thanks for the info above. If you have any ideas why my change is failing it would be appreciated. I guess I could just drop using the decorator as it seems to work okay without it. But I think it is using "in-process" mode by default instead of "subprocess" mode. Not sure if that matters or not.

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/pytest_script_launch_mode branch 2 times, most recently from b598568 to 05ea611 Compare November 25, 2021 23:30
@JohnVillalovos JohnVillalovos marked this pull request as ready for review November 25, 2021 23:38
@JohnVillalovos
Copy link
Member Author

@nejch Thanks for the info above. If you have any ideas why my change is failing it would be appreciated. I guess I could just drop using the decorator as it seems to work okay without it. But I think it is using "in-process" mode by default instead of "subprocess" mode. Not sure if that matters or not.

@nejch I got it figured out. Ready for review. Thanks.

@JohnVillalovos JohnVillalovos requested a review from nejch November 25, 2021 23:39
@nejch
Copy link
Member

nejch commented Nov 27, 2021

@nejch Thanks for the info above. If you have any ideas why my change is failing it would be appreciated. I guess I could just drop using the decorator as it seems to work okay without it. But I think it is using "in-process" mode by default instead of "subprocess" mode. Not sure if that matters or not.

@nejch I got it figured out. Ready for review. Thanks.

Thanks @JohnVillalovos. I hope my comment wasn't too confusing. What you did in tox.ini would also work, I just wanted to say it was not needed for py_func_v4 (hence the failure as it wasnt using the scripts plugin), but only cli_func_v4. What you did here also works but is maybe less scalable as we need to do it for every module instead of the entire suite. So I'll leave it up to you, I'd say you could still add:

[testenv:cli_func_v4]
deps = -r{toxinidir}/requirements-docker.txt
commands =
  pytest --script-launch-mode=subprocess --cov --cov-report xml tests/functional/cli {posargs}

and it would work (but omit it for py_func_v4).

The reason I added subprocess mode initially I think was because it would more closely resemble the environment of a user running the CLI I believe.

Remove the pytest-console-scripts specific config from the global
'[pytest]' config section.

Use the command line option `--script-launch-mode=subprocess`

Closes #1713
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/pytest_script_launch_mode branch from 05ea611 to e80dcb1 Compare November 27, 2021 17:15
@JohnVillalovos
Copy link
Member Author

Thanks @JohnVillalovos. I hope my comment wasn't too confusing. What you did in tox.ini would also work, I just wanted to say it was not needed for py_func_v4 (hence the failure as it wasnt using the scripts plugin), but only cli_func_v4. What you did here also works but is maybe less scalable as we need to do it for every module instead of the entire suite. So I'll leave it up to you, I'd say you could still add:

Thanks @nejch When I got the error before when using the command line argument --script-launch-mode=subprocess I just went and worked around it. I didn't realize that the reason it failed in py_func_v4 was because it wasn't using the plugin. I knew it was being installed so I assumed the command line argument should also work. I'm guessing that if it doesn't use the plugin then the command-line plugin arguments don't get added.

@nejch nejch enabled auto-merge November 27, 2021 17:24
@nejch nejch merged commit 1badfeb into main Nov 27, 2021
@nejch nejch deleted the jlvillal/pytest_script_launch_mode branch November 27, 2021 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Self-test failures on Fedora 35 (python 3.10)
2 participants