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

copy pytest config file to tests/unit directory #160

Merged
merged 1 commit into from
Feb 2, 2024

Commits on Feb 1, 2024

  1. copy pytest config file to tests/unit directory

    The way pytest discovers/collects tests is that if you specify `-c file`
    on the command line, it uses the directory of `file` as the root
    directory and starts looking for files from there, and it does not
    use any other directory, not `--rootdir`, and not any directories
    specified on the command line.
    https://docs.pytest.org/en/latest/reference/customize.html#initialization-determining-rootdir-and-configfile
    
    Which means pytest looks for test files in places where we do not
    want it to look - we only want it to look in the `tests/unit` directory.
    
    This causes problems with github actions because it will look in
    directories where it does not have permission to look, and will fail.
    
    The fix is to copy the pytest config file into the `tests/unit` directory
    and use `pytest -c tests/unit/$configfile ...`.
    richm committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    90e9561 View commit details
    Browse the repository at this point in the history