@@ -1646,25 +1646,15 @@ def test_create_patch_info(self):
1646
1646
self .assertEqual (ft .create_patch_info ({'name' : 'foo.txt' , 'copy' : 'subdir' , 'alt_location' : 'alt' }),
1647
1647
{'name' : 'foo.txt' , 'copy' : 'subdir' , 'alt_location' : 'alt' })
1648
1648
1649
- self .allow_deprecated_behaviour ()
1650
- self .mock_stderr (True )
1651
- self .assertEqual (ft .create_patch_info ('foo.txt' ), {'name' : 'foo.txt' })
1652
- stderr = self .get_stderr ()
1653
- self .mock_stderr (False )
1654
- self .disallow_deprecated_behaviour ()
1655
- expected_warning = "Use of patch file with filename that doesn't end with correct extension: foo.txt "
1656
- expected_warning += "(should be any of: .patch, .patch.bz2, .patch.gz, .patch.xz)"
1657
- fail_msg = "Warning '%s' should appear in stderr output: %s" % (expected_warning , stderr )
1658
- self .assertIn (expected_warning , stderr , fail_msg )
1659
-
1660
- # deprecation warning is treated as an error in context of unit test suite
1661
- expected_error = expected_warning .replace ('(' , '\\ (' ).replace (')' , '\\ )' )
1649
+ expected_error = r"Wrong patch spec \(foo.txt\), extension type should be any of .patch, .patch.bz2, "
1650
+ expected_error += ".patch.gz, .patch.xz."
1662
1651
self .assertErrorRegex (EasyBuildError , expected_error , ft .create_patch_info , 'foo.txt' )
1663
1652
1664
1653
# faulty input
1665
1654
error_msg = "Wrong patch spec"
1666
1655
self .assertErrorRegex (EasyBuildError , error_msg , ft .create_patch_info , None )
1667
1656
self .assertErrorRegex (EasyBuildError , error_msg , ft .create_patch_info , {'copy' : 'subdir' })
1657
+ self .assertErrorRegex (EasyBuildError , error_msg , ft .create_patch_info , {'name' : 'foo.txt' })
1668
1658
self .assertErrorRegex (EasyBuildError , error_msg , ft .create_patch_info , {'name' : 'foo.txt' , 'random' : 'key' })
1669
1659
self .assertErrorRegex (EasyBuildError , error_msg , ft .create_patch_info ,
1670
1660
{'name' : 'foo.txt' , 'copy' : 'subdir' , 'sourcepath' : 'subdir' })
0 commit comments