-
Notifications
You must be signed in to change notification settings - Fork 2
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
--daemon-start-if-needed needs ability to set custom command for starting the daemon #87
Comments
Are you able to solve this using I believe with this: https://pypi.org/project/pytest-gevent/ You can change the value from Its almost midnight for me so I'll check back on this tomorrow morning or afternoon. Thanks! |
Actually looking at the implementation that might not work because it's expecting a module name args = [
sys.executable,
"-m",
pytest_name,
"--daemon",
"--daemon-port",
str(port),
] But maybe writing a wrapper module would work. |
That library is deprecated and it says to use my way in their readme https://github.com/asottile-archive/pytest-gevent
Yep it won't work, just tried some different variations.
That could be it. |
Did the wrapper end up resolving your issue? I'm also curious about your use case because the library doesn't support running tests concurrently (it will turn off xdist via the workaround feature, for example), but maybe you need it for other reasons. |
I wasn't able to work on the wrapper. Use case for this library is just faster test execution locally while working on the codebase. xdist isn't related to this case, though I'm blocked there too on gevent pytest-dev/pytest-xdist#1069. I'll probably use pytest-split for multi-core running of test suite. |
I don't recommend rerunning your whole test suite. The intended use case is the same as you see in the gif in the readme; you execute single tests or test files from the IDE. You would use the CI to automatically run a test suite for your project and in that case you wouldn't see a benefit from using the hot reloader. |
I agree, I never mentioned xdist, you did here:
Maybe you thought (gevent => concurrent-tests)? |
I was just calling it out to maybe save you some time if that was your goal. Another thing is that #!/bin/bash
# Store the first argument, which is assumed to be '-m'
module_flag=$1
# Store the second argument, which is the name of the module, e.g., 'pytest'
module_name=$2
# Remove the first two arguments from the list of all arguments
shift 2
# Run the python command with the modified module and the remaining arguments
python -m gevent --module $module_name "$@" You would then invoke it like this: The daemon args would become: args = [
"my_script",
"-m",
"pytest",
"--daemon",
"--daemon-port",
str(port),
] |
That script doesn't work. I'll just use a runfile from the IDE for now, thank you. |
Hi,
I'm using gevent and I start pytest with:
Using
--daemon-start-if-needed
breaks because it starts pytest normally. Thus need a config to set how to auto start the daemon.The text was updated successfully, but these errors were encountered: