Skip to content

Running pytest fails due to path issues: No such file or directory: 'generated_data/ed25519_metadata' #2745

@jas4711

Description

@jas4711

Hi! I'm working on packaging of Python-TUF for Debian and ran into this self-check failure which I can reproduce in a basic git checkout of d805a81 which is master per 2024-12-06.

Shouldn't running 'pytest' work automatically? Is there some path confusion here, or why does this fail?

root@a9cac658593b:~/python-tuf# pytest
========================================================================== test session starts ==========================================================================
platform linux -- Python 3.12.8, pytest-8.3.3, pluggy-1.5.0
rootdir: /root/python-tuf
configfile: pyproject.toml
plugins: typeguard-4.4.1
collected 184 items / 1 error                                                                                                                                           

================================================================================ ERRORS =================================================================================
__________________________________________________________ ERROR collecting tests/test_metadata_generation.py ___________________________________________________________
tests/test_metadata_generation.py:10: in <module>
    from tests.generated_data.generate_md import generate_all_files
tests/generated_data/generate_md.py:61: in <module>
    os.mkdir(OUT_DIR)
E   FileNotFoundError: [Errno 2] No such file or directory: 'generated_data/ed25519_metadata'
=========================================================================== warnings summary ============================================================================
tests/test_repository.py:42
  /root/python-tuf/tests/test_repository.py:42: PytestCollectionWarning: cannot collect test class 'TestingRepository' because it has a __init__ constructor (from: tests/test_repository.py)
    class TestingRepository(Repository):

tests/test_updater_delegation_graphs.py:31
  /root/python-tuf/tests/test_updater_delegation_graphs.py:31: PytestCollectionWarning: cannot collect test class 'TestDelegation' because it has a __init__ constructor (from: tests/test_updater_delegation_graphs.py)
    @dataclass

tests/test_updater_delegation_graphs.py:42
  /root/python-tuf/tests/test_updater_delegation_graphs.py:42: PytestCollectionWarning: cannot collect test class 'TestTarget' because it has a __init__ constructor (from: tests/test_updater_delegation_graphs.py)
    @dataclass

tests/test_updater_fetch_target.py:22
  /root/python-tuf/tests/test_updater_fetch_target.py:22: PytestCollectionWarning: cannot collect test class 'TestTarget' because it has a __init__ constructor (from: tests/test_updater_fetch_target.py)
    @dataclass

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================== short test summary info ========================================================================
ERROR tests/test_metadata_generation.py - FileNotFoundError: [Errno 2] No such file or directory: 'generated_data/ed25519_metadata'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================== 4 warnings, 1 error in 0.23s ======================================================================
root@a9cac658593b:~/python-tuf# 

Thanks,
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions