mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Use patch.dict in deprecation test "test_check_if_deprecated_constant" (#106117)
This commit is contained in:
parent
56967a92e0
commit
5a3db078d5
@ -293,10 +293,8 @@ def test_check_if_deprecated_constant(
|
|||||||
}
|
}
|
||||||
filename = f"/home/paulus/{module_name.replace('.', '/')}.py"
|
filename = f"/home/paulus/{module_name.replace('.', '/')}.py"
|
||||||
|
|
||||||
# mock module for homeassistant/helpers/frame.py#get_integration_frame
|
# mock sys.modules for homeassistant/helpers/frame.py#get_integration_frame
|
||||||
sys.modules[module_name] = Mock(__file__=filename)
|
with patch.dict(sys.modules, {module_name: Mock(__file__=filename)}), patch(
|
||||||
|
|
||||||
with patch(
|
|
||||||
"homeassistant.helpers.frame.extract_stack",
|
"homeassistant.helpers.frame.extract_stack",
|
||||||
return_value=[
|
return_value=[
|
||||||
Mock(
|
Mock(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user