@@ -33,13 +33,15 @@ def tearDown(self):
3333 editor .setSavePoint ()
3434 notepad .close ()
3535
36+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
3637 def test_replace_function (self ):
3738 editor .rereplace (r'([a-z]+)([0-9]+)' .encode ('windows-1252' ), group2_with_counter )
3839 text = editor .getText ()
3940 self .assertEqual (text , u'1231 54322 983\r \n ä1234 ü54325 ö986\r \n ' .encode ('windows-1252' ))
4041
42+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
4143 def test_unicode_replace_function (self ):
42- editor .rereplace (ur '([a-zäöü]+)([0-9]+)' , group1_with_counter )
44+ editor .rereplace (r '([a-zäöü]+)([0-9]+)' , group1_with_counter )
4345 text = editor .getText ()
4446 self .assertEqual (text , u'abc1 def2 gh3\r \n äbc4 üef5 öh6\r \n ' .encode ('windows-1252' ))
4547
@@ -55,24 +57,27 @@ def groups_check(self, m):
5557 self .assertEqual (m .groups (), groups_data_correct [counter ])
5658 return counter
5759
60+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
5861 def test_groups (self ):
59- editor .rereplace (ur '([a-zäöü]+)([0-9]+)' , lambda m : self .groups_check (m ))
62+ editor .rereplace (r '([a-zäöü]+)([0-9]+)' , lambda m : self .groups_check (m ))
6063 text = editor .getText ()
6164 self .assertEqual (text , '1 2 3\r \n 4 5 6\r \n ' )
6265
63-
66+ @ unittest . skipIf ( notepad . getPluginVersion ()[ 0 ] == '3' , "not yet py3-compatible" )
6467 def test_groups_with_named_groups (self ):
65- editor .rereplace (ur '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : self .groups_check (m ))
68+ editor .rereplace (r '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : self .groups_check (m ))
6669 text = editor .getText ()
6770 self .assertEqual (text , '1 2 3\r \n 4 5 6\r \n ' )
6871
72+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
6973 def test_named_groups (self ):
70- editor .rereplace (ur '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : m .group ('letters' ))
74+ editor .rereplace (r '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : m .group ('letters' ))
7175 text = editor .getText ()
7276 self .assertEqual (text , u'abc def gh\r \n äbc üef öh\r \n ' .encode ('windows-1252' ))
7377
78+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
7479 def test_named_groups_2 (self ):
75- editor .rereplace (ur '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : m .group ('numbers' ))
80+ editor .rereplace (r '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : m .group ('numbers' ))
7681 text = editor .getText ()
7782 self .assertEqual (text , '123 5432 98\r \n 123 5432 98\r \n ' )
7883
@@ -89,8 +94,9 @@ def group_tuples_check(self, m):
8994 self .assertEqual (m .group (2 , 'letters' , 'numbers' ), groups_data_correct [counter ])
9095 return counter
9196
97+ @unittest .skipIf (notepad .getPluginVersion ()[0 ] == '3' , "not yet py3-compatible" )
9298 def test_group_tuples (self ):
93- editor .rereplace (ur '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : self .group_tuples_check (m ))
99+ editor .rereplace (r '(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)' , lambda m : self .group_tuples_check (m ))
94100 text = editor .getText ()
95101 self .assertEqual (text , '1 2 3\r \n 4 5 6\r \n ' )
96102
0 commit comments