blob: f2df47479e27597eb2e9c87951b468681904275a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# coding: utf-8
"""
Support for Pygments tests
"""
import os
import random
def _get_all_test_files():
tests = []
here = os.path.abspath(os.path.dirname(__file__))
for dirpath, dirs, files in os.walk(here):
tests.extend(os.path.join(dirpath, fn) for fn in files
if fn.startswith("test_") and fn.endswith(".py"))
dirs[:] = [d for d in dirs if d.startswith("test_")]
return tests
_testfiles = _get_all_test_files()
def test_file():
"""
Randomly choose a file to test.
"""
return random.choice(_testfiles)
|