@@ -865,7 +865,10 @@ def test_moving_module_refactoring_and_nonexistent_destinations(self):
865865
866866 print(origin_module_in_pkg.a_var)
867867 """ ))
868- with self .assertRaises (exceptions .RefactoringError ):
868+ with self .assertRaisesRegex (
869+ exceptions .RefactoringError ,
870+ r"Move destination for modules should be packages." ,
871+ ):
869872 mover = move .create_move (self .project , self .origin_module_in_pkg )
870873 mover .get_changes (None ).do ()
871874
@@ -1100,7 +1103,10 @@ def a_method(self):
11001103 return 1
11011104 """ )
11021105 self .origin_module .write (code )
1103- with self .assertRaises (exceptions .RefactoringError ):
1106+ with self .assertRaisesRegex (
1107+ exceptions .RefactoringError ,
1108+ r"Destination attribute <x> not found" ,
1109+ ):
11041110 mover = move .create_move (self .project , self .origin_module , code .index ("a_method" ))
11051111 mover .get_changes ("x" , "new_method" )
11061112
@@ -1112,7 +1118,10 @@ def a_method(self):
11121118 return 1
11131119 """ )
11141120 self .origin_module .write (code )
1115- with self .assertRaises (exceptions .RefactoringError ):
1121+ with self .assertRaisesRegex (
1122+ exceptions .RefactoringError ,
1123+ r"Unknown class type for attribute <attr>" ,
1124+ ):
11161125 mover = move .create_move (self .project , self .origin_module , code .index ("a_method" ))
11171126 mover .get_changes ("attr" , "new_method" )
11181127
0 commit comments