mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Fix vscode validation not showing error squiggles (#8500)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							c423a6fb61
						
					
				
				
					commit
					bc56d319b5
				
			| @@ -42,3 +42,23 @@ def test_loading_a_missing_file(fixture_path): | ||||
|         yaml_util.load_yaml(yaml_file) | ||||
|     except EsphomeError as err: | ||||
|         assert "missing.yaml" in str(err) | ||||
|  | ||||
|  | ||||
| def test_parsing_with_custom_loader(fixture_path): | ||||
|     """Test custom loader used for vscode connection | ||||
|     Default loader is tested in test_include_with_vars | ||||
|     """ | ||||
|     yaml_file = fixture_path / "yaml_util" / "includetest.yaml" | ||||
|  | ||||
|     loader_calls = [] | ||||
|  | ||||
|     def custom_loader(fname): | ||||
|         loader_calls.append(fname) | ||||
|  | ||||
|     with open(yaml_file, encoding="utf-8") as f_handle: | ||||
|         yaml_util.parse_yaml(yaml_file, f_handle, custom_loader) | ||||
|  | ||||
|     assert len(loader_calls) == 3 | ||||
|     assert loader_calls[0].endswith("includes/included.yaml") | ||||
|     assert loader_calls[1].endswith("includes/list.yaml") | ||||
|     assert loader_calls[2].endswith("includes/scalar.yaml") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user