Skip to content

Commit 6335039

Browse files
committed
Tidied iter_check_states in test
1 parent 197f27e commit 6335039

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

tests/test_tree_widget.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,11 @@ def test_all_check_state(self):
4242
from sgtk.platform.qt import QtCore, QtGui
4343

4444
def iter_check_states(plugin):
45-
yield from (
46-
tree_item.check_state
47-
for it in QtGui.QTreeWidgetItemIterator(tree_widget)
48-
if (
49-
(tree_item := it.value())
50-
and isinstance(
51-
task := tree_item.get_publish_instance(), self.api.PublishTask
52-
)
53-
and task.plugin == plugin
54-
)
55-
)
45+
for it in QtGui.QTreeWidgetItemIterator(tree_widget):
46+
tree_item = it.value()
47+
task = tree_item.get_publish_instance()
48+
if isinstance(task, self.api.PublishTask) and task.plugin == plugin:
49+
yield tree_item.check_state
5650

5751
tree_widget.set_check_state_for_all_plugins(local_plugin, QtCore.Qt.Checked)
5852
for check_state in iter_check_states(local_plugin):

0 commit comments

Comments
 (0)