Remove unused nonlocals in tests
This commit is contained in:
@@ -39,7 +39,6 @@ def testGuiDocSearch_Main(qtbot, monkeypatch, nwGUI, prjLipsum):
|
|||||||
search = nwGUI.projSearch
|
search = nwGUI.projSearch
|
||||||
|
|
||||||
def totalCount():
|
def totalCount():
|
||||||
nonlocal search
|
|
||||||
res = search.searchResult
|
res = search.searchResult
|
||||||
return sum(
|
return sum(
|
||||||
int(res.topLevelItem(i).text(GuiProjectSearch.C_COUNT).strip("()"))
|
int(res.topLevelItem(i).text(GuiProjectSearch.C_COUNT).strip("()"))
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ def testToolBuildSettings_Init(qtbot, nwGUI, projPath, mockRnd):
|
|||||||
|
|
||||||
@pyqtSlot(BuildSettings)
|
@pyqtSlot(BuildSettings)
|
||||||
def _testNewSettingsReady(new: BuildSettings):
|
def _testNewSettingsReady(new: BuildSettings):
|
||||||
nonlocal build, triggered
|
nonlocal triggered
|
||||||
assert new is build
|
assert new is build
|
||||||
triggered = True
|
triggered = True
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ def testToolWelcome_Open(qtbot, monkeypatch, nwGUI, fncPath):
|
|||||||
|
|
||||||
# Context Menu
|
# Context Menu
|
||||||
def getMenuForPos(pos: QPoint) -> QMenu | None:
|
def getMenuForPos(pos: QPoint) -> QMenu | None:
|
||||||
nonlocal tabOpen
|
|
||||||
tabOpen._openContextMenu(pos)
|
tabOpen._openContextMenu(pos)
|
||||||
for obj in tabOpen.children():
|
for obj in tabOpen.children():
|
||||||
if isinstance(obj, QMenu) and obj.objectName() == "ContextMenu":
|
if isinstance(obj, QMenu) and obj.objectName() == "ContextMenu":
|
||||||
|
|||||||
Reference in New Issue
Block a user