summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2018-11-28 05:54:28 +0100
committerGeorg Brandl <georg@python.org>2018-11-28 05:54:28 +0100
commit075938a7748906f9d20981b90d07cab30b3a3121 (patch)
tree82050755cc9ed897dc01a800a8b2c84d6b3edb5f /tests
parent46c8092c1804b2d19d275024614a22e22f963aef (diff)
downloadpygments-075938a7748906f9d20981b90d07cab30b3a3121.tar.gz
Handle regex syntax FutureWarnings.
Make sure they are converted to errors in test runs, to catch new introductions immediately.
Diffstat (limited to 'tests')
-rw-r--r--tests/run.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/run.py b/tests/run.py
index 07665b2a..bdaceb7e 100644
--- a/tests/run.py
+++ b/tests/run.py
@@ -16,6 +16,7 @@ from __future__ import print_function
import os
import sys
+import warnings
# only find tests in this directory
if os.path.dirname(__file__):
@@ -31,6 +32,9 @@ except ImportError:
# make sure the current source is first on sys.path
sys.path.insert(0, '..')
+# make FutureWarnings (coming from Regex syntax most likely) an error
+warnings.filterwarnings("error", category=FutureWarning)
+
if '--with-coverage' not in sys.argv:
# if running with coverage, pygments should not be imported before coverage
# is started, otherwise it will count already executed lines as uncovered