summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2018-11-28 16:42:15 +0100
committerGeorg Brandl <georg@python.org>2018-11-28 16:42:15 +0100
commitcd850106ed356cd56c2bf19e0eebd75c42780556 (patch)
tree44484ae1e497b8a27117ec7c0288ddeb97807167 /tests
parent42bcf76904ad6ccf1005296a8d1688ebe1bc562d (diff)
downloadpygments-cd850106ed356cd56c2bf19e0eebd75c42780556.tar.gz
Fix more instances of invalid string escapes
Also, raise on warnings from Pygments only.
Diffstat (limited to 'tests')
-rw-r--r--tests/run.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/run.py b/tests/run.py
index 161e5c04..2e962f2f 100644
--- a/tests/run.py
+++ b/tests/run.py
@@ -22,6 +22,13 @@ import warnings
if os.path.dirname(__file__):
os.chdir(os.path.dirname(__file__))
+# make FutureWarnings (coming from Regex syntax most likely) and
+# DeprecationWarnings due to non-raw strings an error
+warnings.filterwarnings("error", module=r"pygments\..*",
+ category=FutureWarning)
+warnings.filterwarnings("error", module=r".*pygments.*",
+ category=DeprecationWarning)
+
try:
import nose
@@ -32,12 +39,6 @@ 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=FutureWarning)
-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