File: update_contrasts.py

package info (click to toggle)
pygments 2.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 10,668 kB
  • sloc: python: 105,287; javascript: 238; makefile: 142; sh: 84; lisp: 74
file content (21 lines) | stat: -rwxr-xr-x 648 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
"""
    Updates tests/contrast/min_contrasts.json
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Whenever you have improved the minimum contrast of a style you should run
    this script, so that the test_contrasts.py test prevents future degredations.
"""

import os
import sys

# always prefer Pygments from source if exists
srcpath = os.path.join(os.path.dirname(__file__), "..")
if os.path.isdir(os.path.join(srcpath, "pygments")):
    sys.path.insert(0, srcpath)

import tests.contrast.test_contrasts # noqa: E402

tests.contrast.test_contrasts.test_contrasts(fail_if_improved=False)
tests.contrast.test_contrasts.update_json()