Skip to content

Commit ab20cf2

Browse files
committed
Reuse existing TestCase.id() method to identify scratch views
1 parent 44324e5 commit ab20cf2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

unittesting/helpers/view_test_case.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ class ViewTestCaseMixin:
1616
"translate_tabs_to_spaces": False,
1717
"word_wrap": False,
1818
}
19-
id = 0
2019

2120
if sys.version_info[:2] >= (3, 8):
2221
def _callSetUp(self):
23-
self.__class__.id += 1
24-
self.panel_name = "unittesting-scratch-{}".format(self.__class__.id)
22+
self.panel_name = "unittesting-scratch-{}".format(self.id())
2523
self.window = sublime.active_window()
2624
self.view = self.window.create_output_panel(self.panel_name, unlisted=True)
2725

@@ -53,8 +51,7 @@ def _callTearDown(self):
5351

5452
else:
5553
def setUp(self):
56-
self.__class__.id += 1
57-
self.panel_name = "unittesting-scratch-{}".format(self.__class__.id)
54+
self.panel_name = "unittesting-scratch-{}".format(self.id())
5855
self.window = sublime.active_window()
5956
self.view = self.window.create_output_panel(self.panel_name, unlisted=True)
6057

0 commit comments

Comments
 (0)