I would like to add a custom pytest marker which skips a test whenever a specific file is found in the directory:
@pytest.mark.file_exists("my_file.txt")
def test_mytest():
assert True
I want test_mytest to execute only when "my_file.txt" is in the root directory. The documentation specifies how to register a custom marker, but not how to define its behavior. How would I define the behavior of file_exists ?
Any help is appreciated.