]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
test: Add an option to disable assertion that logs are empty
authorBen Darnell <ben@cockroachlabs.com>
Fri, 7 Aug 2020 16:26:10 +0000 (12:26 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 2 Sep 2020 15:10:13 +0000 (11:10 -0400)
Use this on windows due to a log spam issue in asyncio.

appveyor.yml
tornado/test/runtests.py

index 732a704370dd2129e6c5b82e541a9a046fe4363c..273eb192c1899b0da5481755251c3ee2676fd0cc 100644 (file)
@@ -60,7 +60,8 @@ environment:
       PYTHON_VERSION: "3.8.x"
       PYTHON_ARCH: "64"
       TOX_ENV: "py38"
-      TOX_ARGS: ""
+      # Suppress the log-cleanliness assertions because of https://bugs.python.org/issue39010
+      TOX_ARGS: "--fail-if-logs=false"
 
 install:
   # Make sure the right python version is first on the PATH.
index 43cdf4d91065f4a82a71be774a21a57b65daa472..484eb9625fe4d4e870f410a6534231dec1f3925a 100644 (file)
@@ -12,7 +12,7 @@ import warnings
 from tornado.httpclient import AsyncHTTPClient
 from tornado.httpserver import HTTPServer
 from tornado.netutil import Resolver
-from tornado.options import define, add_parse_callback
+from tornado.options import define, add_parse_callback, options
 
 
 TEST_MODULES = [
@@ -182,6 +182,11 @@ def main():
             reduce(operator.or_, (getattr(gc, v) for v in values))
         ),
     )
+    define(
+        "fail-if-logs",
+        default=True,
+        help="If true, fail the tests if any log output is produced (unless captured by ExpectLog)",
+    )
 
     def set_locale(x):
         locale.setlocale(locale.LC_ALL, x)
@@ -228,7 +233,8 @@ def main():
                 log_counter.error_count,
                 counting_stderr.byte_count,
             )
-            sys.exit(1)
+            if options.fail_if_logs:
+                sys.exit(1)
 
 
 if __name__ == "__main__":