Repository: locustio/locust

Issue:
Update flask version
Our minimum required flask version is too old (saw at least one person having an issue https://stackoverflow.com/questions/61969924/typeerror-when-i-run-a-locustfile-py)

https://flask.palletsprojects.com/en/1.1.x/changelog/#version-0-12-5 is a minimum, but we should probably go to 1.x right away.

I can do the PR

Discussion:

Patch:
diff --git a/locust/util/deprecation.py b/locust/util/deprecation.py
index cd974678..95a8e312 100644
--- a/locust/util/deprecation.py
+++ b/locust/util/deprecation.py
@@ -20,7 +20,7 @@ def deprecated_locust_meta_class(deprecation_message):
             if classname in ["DeprecatedLocustClass", "DeprecatedHttpLocustClass", "DeprecatedFastHttpLocustClass"]:
                 return super().__new__(mcs, classname, bases, class_dict)
             else:
-                raise ImportError(deprecation_message)
+                raise DeprecationWarning(deprecation_message)
     return MetaClass
 
 class DeprecatedLocustClass(metaclass=deprecated_locust_meta_class(
diff --git a/setup.py b/setup.py
index 80716c5a..26f4eec5 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ setup(
     version=version,
     install_requires=[
         "gevent>=1.5.0",
-        "flask>=0.10.1", 
+        "flask>=1.1.2", 
         "requests>=2.9.1", 
         "msgpack>=0.6.2", 
         "pyzmq>=16.0.2", 


Test patch:
diff --git a/locust/test/test_locust_class.py b/locust/test/test_locust_class.py
index 8ac03776..dbf58d43 100644
--- a/locust/test/test_locust_class.py
+++ b/locust/test/test_locust_class.py
@@ -545,18 +545,10 @@ class TestLocustClass(LocustTestCase):
             from locust.contrib.fasthttp import FastHttpLocust
             class FastLocust(FastHttpLocust):
                 pass
-        
-        def assert_importing_locust_class_raises(func):
-            try:
-                func()
-            except ImportError as e:
-                self.assertIn("Locust class has been renamed to", e.args[0], "ImportError was raised, but with the wrong error message")
-            else:
-                self.fail("ImportError was not raised")
-
-        assert_importing_locust_class_raises(test_locust)
-        assert_importing_locust_class_raises(test_http_locust)
-        assert_importing_locust_class_raises(test_fast_http_locust)
+
+        self.assertRaises(DeprecationWarning, test_locust)
+        self.assertRaises(DeprecationWarning, test_http_locust)
+        self.assertRaises(DeprecationWarning, test_fast_http_locust)
 
 
 class TestWebLocustClass(WebserverTestCase):