diff --git a/pyproject.toml b/pyproject.toml index b33f449b2..4d4b52287 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -183,7 +183,6 @@ disable= [ "comparison-with-callable", "comparison-with-itself", "condition-evals-to-constant", - "consider-iterating-dictionary", "consider-using-dict-items", "consider-using-enumerate", "consider-using-from-import", diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index e6ccebc20..13fc9277a 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -143,7 +143,7 @@ class _NodeReporter: # Filter out attributes not permitted by this test family. # Including custom attributes because they are not valid here. temp_attrs = {} - for key in self.attrs.keys(): + for key in self.attrs: if key in families[self.family]["testcase"]: temp_attrs[key] = self.attrs[key] self.attrs = temp_attrs diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 2c9c0d3b1..973168dc6 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -1267,7 +1267,7 @@ class TerminalReporter: def _set_main_color(self) -> None: unknown_types: List[str] = [] - for found_type in self.stats.keys(): + for found_type in self.stats: if found_type: # setup/teardown reports have an empty key, ignore them if found_type not in KNOWN_TYPES and found_type not in unknown_types: unknown_types.append(found_type)