def test_consider_args_after_options_for_rootdir(
    pytester: Pytester, args: list[str]
) -> None:
    """
    Consider all arguments in the command-line for rootdir
    discovery, even if they happen to occur after an option. #949
    """
    # replace "dir1" and "dir2" from "args" into their real directory
    root = pytester.mkdir("myroot")
    d1 = root.joinpath("dir1")
    d1.mkdir()
    d2 = root.joinpath("dir2")
    d2.mkdir()
    for i, arg in enumerate(args):
        if arg == "dir1":
            args[i] = str(d1)
        elif arg == "dir2":
            args[i] = str(d2)
    with MonkeyPatch.context() as mp:
        mp.chdir(root)
        result = pytester.runpytest(*args)
    result.stdout.fnmatch_lines(["*rootdir: *myroot"])

    Consider all arguments in the command-line for rootdir
    discovery, even if they happen to occur after an option. #949
    
testing/test_config.py