def build_dupe_index(): """ Return a set of existing generated copyright tests (to avoid duplication) """ existing = set() for test in cluecode_test_utils.load_copyright_tests(): try: with io.open(test.test_file) as tf: existing.add(tf.read().strip()) except UnicodeDecodeError: with io.open(test.test_file, "rb") as tf: existing.add(tf.read().strip()) return existing
# for any legal advice. # ScanCode is a free software code scanning tool from nexB Inc. and others. # Visit https://github.com/nexB/scancode-toolkit/ for support and download. from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import pytest from cluecode_test_utils import build_tests from cluecode_test_utils import load_copyright_tests from commoncode.testcase import FileBasedTesting pytestmark = pytest.mark.scanslow """ This test suite is based on many sources including a rather large subset of Android ICS, providing a rather diversified sample of a typical Linux-based user space environment. """ class TestCopyrightDataDriven(FileBasedTesting): # test functions are attached to this class at module import time pass build_tests(copyright_tests=load_copyright_tests(), clazz=TestCopyrightDataDriven, regen=False)
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from commoncode.testcase import FileBasedTesting from cluecode_test_utils import build_tests from cluecode_test_utils import load_copyright_tests # Python 2 and 3 support try: # Python 2 unicode except NameError: # Python 3 unicode = str # NOQA """ This test suite is based on many sources including a rather large subset of Android ICS, providing a rather diversified sample of a typical Linux-based user space environment. """ class TestCopyrightDataDriven(FileBasedTesting): # test functions are attached to this class at module import time pass build_tests(copyright_tests=load_copyright_tests(), clazz=TestCopyrightDataDriven, regen=False)