Skip to content

Commit fed2a27

Browse files
committed
Merge pull request opencv#10142 from alalek:pytests_update
2 parents d59472b + 019de55 commit fed2a27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/python/test/test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
from __future__ import print_function
44

5+
import sys
6+
sys.dont_write_bytecode = True # Don't generate .pyc files / __pycache__ directories
7+
58
import os
69
import unittest
710

@@ -17,7 +20,7 @@
1720
basedir = os.path.abspath(os.path.dirname(__file__))
1821

1922
def load_tests(loader, tests, pattern):
20-
tests.addTests(loader.discover(basedir, pattern='test_*.py'))
23+
tests.addTests(loader.discover(basedir, pattern=os.environ.get('OPENCV_PYTEST_FILTER', 'test_') + '*.py'))
2124
return tests
2225

2326
if __name__ == '__main__':

0 commit comments

Comments
 (0)