Open kloczek opened 1 year ago
It looks like in come units is hardcoded python
interpreter name (it shopuld be used sys.executable
)
Here is pytest output:
Just tested 1.0.1 and pytest is stil failing but now different way
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' --import-mode=importlib
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/LibCST-1.0.1
plugins: hypothesis-6.75.3
collected 2003 items / 2 errors
==================================== ERRORS ====================================
_______ ERROR collecting libcst/metadata/tests/test_full_repo_manager.py _______
libcst/metadata/tests/test_full_repo_manager.py:11: in <module>
from libcst.metadata.tests.test_type_inference_provider import _test_simple_class_helper
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:172: in exec_module
exec(co, module.__dict__)
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/metadata/tests/test_type_inference_provider.py:19: in <module>
from libcst.tests.test_pyre_integration import TEST_SUITE_PATH
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:172: in exec_module
exec(co, module.__dict__)
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/tests/test_pyre_integration.py:87: in <module>
class PyreIntegrationTest(UnitTest):
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/testing/utils.py:168: in __new__
populate_data_provider_tests(dct)
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/testing/utils.py:94: in populate_data_provider_tests
raise ValueError(
E ValueError: No data_provider tests were created for test_type_availability! Please double check your data.
____ ERROR collecting libcst/metadata/tests/test_type_inference_provider.py ____
libcst/metadata/tests/test_type_inference_provider.py:19: in <module>
from libcst.tests.test_pyre_integration import TEST_SUITE_PATH
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:172: in exec_module
exec(co, module.__dict__)
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/tests/test_pyre_integration.py:87: in <module>
class PyreIntegrationTest(UnitTest):
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/testing/utils.py:168: in __new__
populate_data_provider_tests(dct)
../../BUILDROOT/python-libcst-1.0.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/libcst/testing/utils.py:94: in populate_data_provider_tests
raise ValueError(
E ValueError: No data_provider tests were created for test_type_availability! Please double check your data.
=============================== warnings summary ===============================
libcst/codemod/tests/test_metadata.py:15
/home/tkloczko/rpmbuild/BUILD/LibCST-1.0.1/libcst/codemod/tests/test_metadata.py:15: PytestCollectionWarning: cannot collect test class 'TestingCollector' because it has a __init__ constructor (from: libcst/codemod/tests/test_metadata.py)
class TestingCollector(ContextAwareVisitor):
libcst/codemod/tests/test_metadata.py:23
/home/tkloczko/rpmbuild/BUILD/LibCST-1.0.1/libcst/codemod/tests/test_metadata.py:23: PytestCollectionWarning: cannot collect test class 'TestingTransform' because it has a __init__ constructor (from: libcst/codemod/tests/test_metadata.py)
class TestingTransform(ContextAwareTransformer):
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR libcst/metadata/tests/test_full_repo_manager.py - ValueError: No data_p...
ERROR libcst/metadata/tests/test_type_inference_provider.py - ValueError: No ...
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
======================== 2 warnings, 2 errors in 9.48s =========================
Here is pytest output after add those two files to --ignore list:
Looks like the issue here is that pytest
is running from an installed wheel. Some test cases include test data, which is not part of the installed wheel, and so they blow up in this weird way. I'm not even sure the tests themselves should be packaged with the wheel, to be honest.
Just found that libcst/tests is part of the installed resources. Test suite should not be installed.
Tests fails similarly when run from sdist too. So it looks like the sdist is missing some data, as suggested above.
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesHere is list of installed modules in build env