Skip to content

pytest 9 imports files it should not #292

@jku

Description

@jku

When pytest 9 is used action.py ends up importing files from the working directory. This can be problematic because when running in a workflow the working dir is client git root and may contain pytest files like conftest.py from the clients test suite.

Reproduction steps:

  • make sure there is a branch of sigstore-conformance with pytest 9 (like dependabot/pip/pytest-9.0.1)
  • create a branch of sigstore-python, modify the workflow so it uses sigstore-conformance pytest branch
  • run the conformance workflow from the sigstore-python branch

This is what a test run looks like:

Run ./sigstore-conformance-env/bin/python /home/runner/work/_actions/sigstore/sigstore-conformance/main/action.py
ImportError while loading conftest '/home/runner/work/sigstore-python/sigstore-python/test/conftest.py'.
test/conftest.py:19: in <module>
    from id import (
E   ModuleNotFoundError: No module named 'id'
running sigstore-conformance against Sigstore production infrastructure

I suspect this is a pytest bug but have not filed anything yet -- the reproducer is very complicated currently

I plan to revert the pytest upgrade for now

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions