summaryrefslogtreecommitdiff
path: root/tests/run.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2018-11-28 15:49:16 +0100
committerGeorg Brandl <georg@python.org>2018-11-28 15:49:16 +0100
commitcdb2a89a25131f46a09a5497e56196c2fe69e184 (patch)
treec968abf8f6ab5ad17e6bc96624c12e1600e1ddeb /tests/run.py
parentb9ae9547d99e4219df253ddeb61598c26b0f3032 (diff)
downloadpygments-cdb2a89a25131f46a09a5497e56196c2fe69e184.tar.gz
Fix invalid escapes due to missing raw string prefix.
Diffstat (limited to 'tests/run.py')
-rw-r--r--tests/run.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/run.py b/tests/run.py
index 07665b2a..41279bef 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,11 @@ except ImportError:
# make sure the current source is first on sys.path
sys.path.insert(0, '..')
+# make FutureWarnings (coming from Regex syntax most likely) and
+# DeprecationWarnings (coming from invalid escapes due to non-raw strings)
+# an error
+warnings.filterwarnings("error", category=DeprecationWarning)
+
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