1010 unicode_literals , with_statement )
1111
1212import logging
13- import random
1413import unittest
1514
1615from tmuxp import Pane , Session , Window
1716from tmuxp .testsuite import t
18- from tmuxp .testsuite .helpers import TEST_SESSION_PREFIX , TmuxTestCase
17+ from tmuxp .testsuite .helpers import TEST_SESSION_PREFIX , TmuxTestCase , namer
1918
2019logger = logging .getLogger (__name__ )
2120
@@ -62,9 +61,7 @@ def test_findWhere_None(self):
6261 """.findWhere returns None if no results found."""
6362
6463 while True :
65- nonexistant_session = TEST_SESSION_PREFIX + str (
66- random .randint (0 , 9999 )
67- )
64+ nonexistant_session = TEST_SESSION_PREFIX + next (namer )
6865
6966 if not t .has_session (nonexistant_session ):
7067 break
@@ -176,7 +173,7 @@ def test_getById(self):
176173 self .assertEqual (get_by_id , session )
177174 self .assertIsInstance (get_by_id , Session )
178175 self .assertIsNone (t .getById (
179- '$' + str ( random . randint ( 50000 , 90000 ) )
176+ '$' + next ( namer )
180177 ))
181178
182179 # session.getById
@@ -189,7 +186,7 @@ def test_getById(self):
189186 self .assertIsInstance (get_by_id , Window )
190187
191188 self .assertIsNone (session .getById (
192- '@' + str ( random . randint ( 50000 , 90000 ) )
189+ '@' + next ( namer )
193190 ))
194191
195192 # window.getById
@@ -201,7 +198,7 @@ def test_getById(self):
201198 self .assertEqual (get_by_id , pane )
202199 self .assertIsInstance (get_by_id , Pane )
203200 self .assertIsNone (window .getById (
204- '%' + str ( random . randint ( 50000 , 90000 ) )
201+ '%' + next ( namer )
205202 ))
206203
207204
0 commit comments