From 5d98398b5e9dde72a52ca7becd3acf7680ea2788 Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Wed, 21 Aug 2024 08:40:56 +0200 Subject: [PATCH] update --- ostap/io/tests/test_io_dbases.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ostap/io/tests/test_io_dbases.py b/ostap/io/tests/test_io_dbases.py index 99cf90c6..ce685f5e 100644 --- a/ostap/io/tests/test_io_dbases.py +++ b/ostap/io/tests/test_io_dbases.py @@ -24,14 +24,22 @@ if '__main__' == __name__ : logger = getLogger ( 'test_io_dbases' ) else : logger = getLogger ( __name__ ) # ============================================================================= -characters = "abcdefghijklmnopqrstuvwxyz0123456789_" -# ============================================================================= -## generate random name -def the_name (): - """ Generate random name""" - return ''.join ( random.choices ( characters , k = 8 ) ) -# ============================================================================= - +if (3,0) <= sys.version_info : + characters = "abcdefghijklmnopqrstuvwxyz0123456789_" + # ============================================================================= + ## generate random name + def the_name (): + """ Generate random name""" + return ''.join ( random.choices ( characters , k = 8 ) ) + # ============================================================================= +else : + # ============================================================================= + index = 1 + def _the_name () : + index += 1 + return 'i%08d' % index + # ============================================================================= + dbases = [] # ============================================================================