eliben / pyelftools

Parsing ELF and DWARF in Python
Other
1.99k stars 507 forks source link

Which one `utils`?🤔 #544

Closed kloczek closed 5 months ago

kloczek commented 5 months ago

Test suite needs utils

________________________________________________________________________ ERROR collecting test/run_examples_test.py _________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/pyelftools-0.31/test/run_examples_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/run_examples_test.py:12: in <module>
    from utils import run_exe, is_in_rootdir, dump_output_to_temp_files
E   ModuleNotFoundError: No module named 'utils'
================================================================================== short test summary info ==================================================================================

and https://pypi.org/search/?q=pyutils and https://pypi.org/search/?q=utils shows at lease three different modules with that name 😋 Which one should be used? 🤔

eliben commented 5 months ago

This is the test file you should be running if you're doing it manually: https://github.com/eliben/pyelftools/blob/main/test/all_tests.py

The test runners look for their own utils in the test directory

kloczek commented 5 months ago

So this is test suite issue? 🤔

kloczek commented 5 months ago

BTW .. pytest looking for test units scans only those files with ^test in file names so it would be good to rename some files to be able use them with pytest.