Ho un pytest file che richiede un ambiente impostata. Quindi, aggiungere i seguenti decoratore su ogni funzione.
@pytest.mark.skipif('password' not in os.environ,
reason='Environment variable "password" not set.')
def test_1(mock):
....
@pytest.mark.skipif('password' not in os.environ,
reason='Environment variable "password" not set.')
def test_2(mock):
....
@pytest.mark.skipif('password' not in os.environ,
reason='Environment variable "password" not set.')
def test_3(mock):
....
È un modo per saltare tutti i test, invece di decorare ogni funzione di test?
BTW, è solo saltare i test con il seguente messaggio. È un modo per visualizzare un avviso informazioni mancanti variabile di ambiente?
====== 25 skipped in 5.96s =======