File: profile.py

package info (click to toggle)
python-tld 0.13-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,008 kB
  • sloc: python: 12,972; sh: 119; makefile: 19
file content (33 lines) | stat: -rw-r--r-- 626 bytes parent folder | download
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
26
27
28
29
30
31
32
33
import os
import sys

from tld import get_tld

path = os.path.join(os.path.abspath(os.path.dirname(__name__)), "benchmarks")

sys.path.insert(0, path)

from constants import TEST_CYCLES, URLS  # noqa

try:
    if callable(profile):  # noqa
        pass
except Exception:
    from fallbacks import profile


@profile
def main():
    for _ in range(TEST_CYCLES):
        for url in URLS:
            get_tld(
                url,
                fix_protocol=True,
                search_public=True,
                search_private=True,
                fail_silently=True,
            )


if __name__ == "__main__":
    main()