Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/tools/wpt/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  test_run.py

  Sprache: Python
 

# mypy: allow-untyped-defs

import tempfile
import shutil
import sys
from unittest import mock

import pytest

from tools.wpt import run
from tools import localpaths  # noqa: F401
from wptrunner.products import get_all_products


@pytest.fixture(scope="module")
def venv():
    from tools.wpt import virtualenv

    class Virtualenv(virtualenv.Virtualenv):
        def __init__(self):
            self.path = tempfile.mkdtemp()
            self.skip_virtualenv_setup = False

        def create(self):
            return

        def activate(self):
            return

        def start(self):
            return

        def install(self, *requirements):
            return

        def install_requirements(self, *requirements):
            return

    venv = Virtualenv()
    yield venv

    shutil.rmtree(venv.path)


@pytest.fixture(scope="module")
def logger():
    run.setup_logging({})


@pytest.mark.parametrize("platform", ["Windows""Linux""Darwin"])
def test_check_environ_fail(platform):
    m_open = mock.mock_open(read_data=b"")

    with mock.patch.object(run, "open", m_open):
        with mock.patch.object(run.platform, "uname",
                               return_value=(platform, """""""""")):
            with pytest.raises(run.WptrunError) as excinfo:
                run.check_environ("foo")

    assert "wpt make-hosts-file" in str(excinfo.value)


@pytest.mark.parametrize("product", list(get_all_products()))
def test_setup_wptrunner(venv, logger, product):
    if product == "firefox_android":
        pytest.skip("Android emulator doesn't work on docker")
    parser = run.create_parser()
    kwargs = vars(parser.parse_args(["--channel=nightly", product]))
    kwargs["prompt"] = False
    # Hack to get a real existing path
    kwargs["binary"] = sys.argv[0]
    kwargs["webdriver_binary"] = sys.argv[0]
    if kwargs["product"] == "sauce":
        kwargs["sauce_browser"] = "firefox"
        kwargs["sauce_version"] = "63"
    run.setup_wptrunner(venv, **kwargs)

Messung V0.5 in Prozent
C=90 H=95 G=92

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.