import random
import pytest
WORDS = ['foo', 'bar']

def test_maybe_recursive():
    word1 = random.choice(WORDS)
word2 = random.choice(WORDS)
while word1 == word2:
    print('The two words are the same. Re-running the test...')
word1 = random.choice(WORDS)
word2 = random.choice(WORDS)
assert word1 != word2
if __name__ == '__main__':
    test_maybe_recursive()
Is there a command to make a Pytest restart?