Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/python/mach/mach/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 818 B image not shown  

Quelle  test_mach.py   Sprache: Python

 
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os

from mozunit import main


def test_set_isatty_environ(monkeypatch, get_mach):
    # Make sure the 'MACH_STDOUT_ISATTY' variable gets set.
    monkeypatch.delenv("MACH_STDOUT_ISATTY", raising=False)
    monkeypatch.setattr(os, "isatty"lambda fd: True)

    m = get_mach()
    orig_run = m._run
    env_is_set = []

    def wrap_run(*args, **kwargs):
        env_is_set.append("MACH_STDOUT_ISATTY" in os.environ)
        return orig_run(*args, **kwargs)

    monkeypatch.setattr(m, "_run", wrap_run)

    ret = m.run([])
    assert ret == 0
    assert env_is_set[0]


if __name__ == "__main__":
    main()

86%


¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.