Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell-style wildcard support to 'testpaths' #9897

Merged
merged 1 commit into from May 24, 2022

Commits on Apr 28, 2022

  1. Add shell-style wildcard support to 'testpaths'

    This is especially useful for large repositories (e.g. monorepos) that
    use a hierarchical file system organization for nested test paths.
    
        src/*/tests
    
    The implementation uses the standard `glob` module to perform wildcard
    expansion in Config.parse().
    
    The related logic that determines whether or not to include 'testpaths'
    in the terminal header was previously relying on a weak heuristic: if
    Config.args matched 'testpaths', then its value was printed. That
    generally worked, but it could also print when the user explicitly used
    the same arguments on the command-line as listed in 'testpaths'. Not a
    big deal, but it shows that the check was logically incorrect.
    
    Now that 'testpaths' can contain wildcards, it's no longer possible to
    perform this simple comparison, so this change also introduces a public
    Config.ArgSource enum and Config.args_source attribute that explicitly
    names the "source" of the arguments: the command line, the invocation
    directory, or the 'testdata' configuration value.
    jparise committed Apr 28, 2022
    Copy the full SHA
    a3c2b18 View commit details
    Browse the repository at this point in the history