microsoft / restler-fuzzer

RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.
MIT License
2.52k stars 283 forks source link

Fix pytest warnings #851

Closed eddyashton closed 5 months ago

eddyashton commented 5 months ago

(minor)

Noticed in the CI while looking for pre-built binaries that the EngineUnitTests contained a few warnings:

https://dev.azure.com/ms/restler-fuzzer/_build/results?buildId=525358&view=logs&j=c1a1743c-78a2-53ee-8834-cd0bb3870179&t=401e5d2e-45d7-5aab-9556-6862a0474420&l=30

=============================== warnings summary ===============================
unit_tests/test_restler_settings.py:576
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:576: DeprecationWarning: invalid escape sequence \w
    self.assertEqual('(\w*)/blog/posts(\w*)', settings.path_regex)

test_restler_settings.py::RestlerSettingsTest::test_multiple_auth_options
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:376: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(OptionValidationError, "Must specify only one token authentication mechanism"):

test_restler_settings.py::RestlerSettingsTest::test_refresh_cmd_no_interval
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:319: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(OptionValidationError, "Must specify refresh period"):

test_restler_settings.py::RestlerSettingsTest::test_refresh_interval_no_method
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:397: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(OptionValidationError, "Must specify token refresh method"):

test_restler_settings.py::RestlerSettingsTest::test_refresh_location_no_interval
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:389: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(OptionValidationError, "Must specify refresh period"):

test_restler_settings.py::RestlerSettingsTest::test_refresh_module_file_does_not_exist
  /home/vsts/work/1/s/restler/unit_tests/test_restler_settings.py:352: DeprecationWarning: Please use assertRaisesRegex instead.
    with self.assertRaisesRegexp(OptionValidationError, "module file does not exist"):
marina-p commented 5 months ago

Thanks for the fixes!