mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 04:36:36 +08:00
019de554a0
Tests are usually lauched from source directory, so additional unnecessary files should be eliminated. Alternative ways (command line): - python -B ... - PYTHONDONTWRITEBYTECODE=1 python ...
28 lines
650 B
Python
Executable File
28 lines
650 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
from __future__ import print_function
|
|
|
|
import sys
|
|
sys.dont_write_bytecode = True # Don't generate .pyc files / __pycache__ directories
|
|
|
|
import os
|
|
import unittest
|
|
|
|
# Python 3 moved urlopen to urllib.requests
|
|
try:
|
|
from urllib.request import urlopen
|
|
except ImportError:
|
|
from urllib import urlopen
|
|
|
|
from tests_common import NewOpenCVTests
|
|
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
def load_tests(loader, tests, pattern):
|
|
tests.addTests(loader.discover(basedir, pattern=os.environ.get('OPENCV_PYTEST_FILTER', 'test_') + '*.py'))
|
|
return tests
|
|
|
|
if __name__ == '__main__':
|
|
NewOpenCVTests.bootstrap()
|