pytest-dev / pytest-timeout

MIT License
206 stars 63 forks source link

Unable to set 'timeout_disable_debugger_detection' in the ini file #175

Open HarryLong opened 2 months ago

HarryLong commented 2 months ago

Setting 'timeout_disable_debugger_detection' to true in the ini file has no effect.

How to reproduce:

  1. Set timeout_disable_debugger_detection to true in the ini file
  2. Launch with debugger attached -> the timeout is ignored

It seems config.getvalue("timeout_disable_debugger_detection") in get_env_settings(config) always returns False and therefore the value in the ini file is never checked.

My suspicion is that the addoption of timeout_disable_debugger_detection initializes the variable to False if not specified (e.g store_false)

flub commented 2 months ago

Hi Harry,

Would you be able to create a PR to fix this? Including with a test?

Thanks! Floris

On Tue 02 Jul 2024 at 08:18 -0700, Harry wrote:

Setting 'timeout_disable_debugger_detection' to true in the ini file has no effect.

How to reproduce:

  1. Set timeout_disable_debugger_detection to true in the ini file
  2. Launch with debugger attached -> the timeout is ignored

It seems config.getvalue("timeout_disable_debugger_detection") in get_env_settings(config) always returns False and therefore the value in the ini file is never checked.

My suspicion is that the addoption of timeout_disable_debugger_detection initializes the variable to False if not specified (e.g store_false)