diff --git a/Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini b/Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini index f5e502255..690f41a72 100644 --- a/Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini +++ b/Src/IronPythonTest/Cases/AllCPythonCasesManifest.ini @@ -276,16 +276,9 @@ Ignore=true [AllCPython.test_docxmlrpc] Ignore=true -[AllCPython.test_email_codecs] -Ignore=true -IsolationLevel=ENGINE - [AllCPython.test_email] Ignore=true -[AllCPython.test_email_renamed] -Ignore=true - [AllCPython.test_enumerate] Ignore=true Reason=Causes StackOverflowException diff --git a/Src/IronPythonTest/Util/IniParser.cs b/Src/IronPythonTest/Util/IniParser.cs index 5761b476a..a781bbd1d 100644 --- a/Src/IronPythonTest/Util/IniParser.cs +++ b/Src/IronPythonTest/Util/IniParser.cs @@ -20,19 +20,20 @@ public string GetValue(string sectionName, string key) { public string GetValue(string sectionName, string key, string @default) { sectionName = string.IsNullOrEmpty(sectionName) ? "DEFAULT" : sectionName; - Section section; - if (!this.options.TryGetValue(sectionName, out section)) { - section = this.options["DEFAULT"]; - } - string value; - if (!section.TryGetValue(key, out value)) { - if (!this.options["DEFAULT"].TryGetValue(key, out value)) { - return @default; + while ((sectionName = GetParentSection(sectionName, out Section section)) != null) { + if (section.TryGetValue(key, out value)) { + return value; } } - return value; + return options["DEFAULT"].TryGetValue(key, out value) ? value : @default; + } + + private string GetParentSection(string sectionName, out Section section) { + var idx = sectionName.LastIndexOf('.'); + var newSectionName = idx == -1 ? null : sectionName.Substring(0, idx); + return options.TryGetValue(sectionName, out section) || newSectionName == null ? newSectionName : GetParentSection(newSectionName, out section); } public bool GetBool(string sectionName, string key) {