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

Modernize test_manifest to use new log infra #3701

Merged
merged 4 commits into from
Nov 22, 2022

Conversation

abravalheri
Copy link
Contributor

Currently some tests in test_manifest only run for SETUPTOOLS_USE_DISTUTILS=stdlib because they rely on the old logging infrastructure.

In pypa/distutils#192 I also noticed that if distutils.log.Log is reinstated for backward compatibility, these tests will fail.

Summary of changes

  • This PR "modernizes" test_manifest a little bit to not rely on the old logging infrastructure.

Closes

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review November 22, 2022 12:19
@abravalheri abravalheri changed the title Modernize test_manifest to use new log infra Modernize test_manifest to use new log infra Nov 22, 2022
@abravalheri
Copy link
Contributor Author

For some reason the CI is not kicking in...

@abravalheri
Copy link
Contributor Author

abravalheri commented Nov 22, 2022

I tried to replicate locally the failing CI job with `PyPy 7.3.9 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)`, without success.
$ tox -e pypy3 -- -p no:cov -p no:perf setuptools/tests/test_manifest.py
pypy3 develop-inst-noop: /home/abravalheri/workspace/setuptools
pypy3 installed: attrs==22.1.0,autocommand==2.2.2,build==0.9.0,cffi==1.15.0,distlib==0.3.6,docutils==0.19,exceptiongroup==1.0.4,execnet==1.9.0,filelock==3.8.0,flake8==4.0.1,flake8-2020==1.6.1,greenlet==0.4.13,hpy==0.0.3,importlib-metadata==5.0.0,ini2toml==0.11.1,iniconfig==1.1.1,jaraco.context==4.2.0,jaraco.envs==2.4.0,jaraco.functools==3.5.2,jaraco.path==3.4.0,mccabe==0.6.1,more-itertools==9.0.0,packaging==21.3,path==16.5.0,pep517==0.13.0,pip-run==8.8.2,platformdirs==2.5.4,pluggy==1.0.0,py==1.11.0,pycodestyle==2.8.0,pyflakes==2.4.0,pyparsing==3.0.9,pytest==7.2.0,pytest-checkdocs==2.9.0,pytest-enabler==1.3.0,pytest-flake8==1.1.1,pytest-perf==0.12.1,pytest-timeout==2.1.0,pytest-xdist==3.0.2,pytz==2022.6,readline==6.2.4.1,six==1.16.0,tempora==5.1.0,toml==0.10.2,tomli==2.0.1,tomli_w==1.0.0,tox==3.27.1,virtualenv==20.16.7,zipp==3.10.0
pypy3 run-test-pre: PYTHONHASHSEED='147068396'
pypy3 run-test: commands[0] | pytest -p no:cov -p no:perf setuptools/tests/test_manifest.py
# ...
....................................................................                             [100%]
========================================== 68 passed in 9.62s ==========================================
_______________________________________________ summary ________________________________________________
  pypy3: commands succeeded
  congratulations :)
I also tried to create a small standalone test for PyPy and caplog, but things seem to work fine...
rm -rf /tmp/test-caplog-pypy
mkdir /tmp/test-caplog-pypy
cd /tmp/test-caplog-pypy
pypy3.9 -m venv .venv
.venv/bin/python -m pip install -U pip pytest
cat <<EOF > test_caplog.py
import logging
import pytest

def test_caplog(caplog):
	caplog.set_level(logging.DEBUG)
	logging.warning("hello world")
	print(caplog.records)
	assert len(caplog.records) > 0
EOF
.venv/bin/pytest test_caplog.py

I wonder if there is something particular about the way GHA sets up pypy3...

Meanwhile I added an xfail for that specific scenario.

@abravalheri abravalheri marked this pull request as ready for review November 22, 2022 19:04
@jaraco jaraco merged commit b9dfcb8 into pypa:main Nov 22, 2022
@abravalheri abravalheri deleted the update-test-manifest branch November 22, 2022 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants