Merge 0923cb00c5 into 877527cefc
This commit is contained in:
commit
cf36414fca
@ -2,6 +2,5 @@
|
||||
|
||||
set -e
|
||||
|
||||
python3 -m coverage erase
|
||||
make clean
|
||||
make install-coverage
|
||||
|
||||
@ -24,14 +24,7 @@ sudo apt-get -qq install libfreetype6-dev liblcms2-dev libtiff-dev python3-tk\
|
||||
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install --upgrade wheel
|
||||
python3 -m pip install coverage
|
||||
python3 -m pip install defusedxml
|
||||
python3 -m pip install ipython
|
||||
python3 -m pip install olefile
|
||||
python3 -m pip install -U pytest
|
||||
python3 -m pip install -U pytest-cov
|
||||
python3 -m pip install -U pytest-timeout
|
||||
python3 -m pip install pyroma
|
||||
# optional test dependencies, only install if there's a binary package.
|
||||
python3 -m pip install --only-binary=:all: numpy || true
|
||||
python3 -m pip install --only-binary=:all: pyarrow || true
|
||||
|
||||
@ -4,4 +4,5 @@ set -e
|
||||
|
||||
python3 -c "from PIL import Image"
|
||||
|
||||
python3 -bb -m pytest -vv -x -W always --cov PIL --cov Tests --cov-report term --cov-report xml Tests $REVERSE
|
||||
python3 -bb -m pytest -vv -x -W always Tests -m "isolated" -n0
|
||||
python3 -bb -m pytest -vv -x -W always Tests -m "not isolated" --cov PIL --cov Tests --cov-report term --cov-report xml $REVERSE
|
||||
|
||||
2
.github/workflows/test-mingw.yml
vendored
2
.github/workflows/test-mingw.yml
vendored
@ -74,7 +74,7 @@ jobs:
|
||||
pushd depends && ./install_extra_test_images.sh && popd
|
||||
|
||||
- name: Build Pillow
|
||||
run: CFLAGS="-coverage" python3 -m pip install .
|
||||
run: CFLAGS="-coverage" python3 -m pip install .[tests]
|
||||
|
||||
- name: Test Pillow
|
||||
run: |
|
||||
|
||||
7
.github/workflows/test-valgrind-memory.yml
vendored
7
.github/workflows/test-valgrind-memory.yml
vendored
@ -60,5 +60,10 @@ jobs:
|
||||
run: |
|
||||
# The Pillow user in the docker container is UID 1001
|
||||
sudo chown -R 1001 $GITHUB_WORKSPACE
|
||||
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
|
||||
docker run --name pillow_container \
|
||||
-e "PILLOW_VALGRIND_TEST=true" \
|
||||
-e "PYTEST_ADDOPTS=-n0" \
|
||||
-v $GITHUB_WORKSPACE:/Pillow \
|
||||
pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} \
|
||||
bash -c "python3 -m pip install pytest-xdist && /Pillow/depends/docker-test-valgrind-memory.sh"
|
||||
sudo chown -R runner $GITHUB_WORKSPACE
|
||||
|
||||
6
.github/workflows/test-valgrind.yml
vendored
6
.github/workflows/test-valgrind.yml
vendored
@ -54,5 +54,9 @@ jobs:
|
||||
run: |
|
||||
# The Pillow user in the docker container is UID 1001
|
||||
sudo chown -R 1001 $GITHUB_WORKSPACE
|
||||
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
|
||||
docker run --name pillow_container \
|
||||
-e "PILLOW_VALGRIND_TEST=true" \
|
||||
-e "PYTEST_ADDOPTS=-n0" \
|
||||
-v $GITHUB_WORKSPACE:/Pillow \
|
||||
pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
|
||||
sudo chown -R runner $GITHUB_WORKSPACE
|
||||
|
||||
8
Makefile
8
Makefile
@ -62,7 +62,7 @@ install:
|
||||
|
||||
.PHONY: install-coverage
|
||||
install-coverage:
|
||||
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip -v install .
|
||||
CFLAGS="-coverage -Werror=implicit-function-declaration" python3 -m pip -v install .[tests]
|
||||
python3 selftest.py
|
||||
|
||||
.PHONY: debug
|
||||
@ -97,12 +97,6 @@ test:
|
||||
python3 -c "import pytest" > /dev/null 2>&1 || python3 -m pip install pytest
|
||||
python3 -m pytest -qq
|
||||
|
||||
.PHONY: test-p
|
||||
test-p:
|
||||
python3 -c "import xdist" > /dev/null 2>&1 || python3 -m pip install pytest-xdist
|
||||
python3 -m pytest -qq -n auto
|
||||
|
||||
|
||||
.PHONY: valgrind
|
||||
valgrind:
|
||||
python3 -c "import pytest_valgrind" > /dev/null 2>&1 || python3 -m pip install pytest-valgrind
|
||||
|
||||
@ -216,6 +216,7 @@ def mark_if_feature_version(
|
||||
return pytest.mark.pil_noop_mark()
|
||||
|
||||
|
||||
@pytest.mark.isolated
|
||||
@pytest.mark.skipif(sys.platform.startswith("win32"), reason="Requires Unix or macOS")
|
||||
class PillowLeakTestCase:
|
||||
# requires unix/macOS
|
||||
|
||||
@ -72,6 +72,7 @@ optional-dependencies.tests = [
|
||||
"pyroma>=5",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-sugar",
|
||||
"pytest-timeout",
|
||||
"pytest-xdist",
|
||||
"trove-classifiers>=2024.10.12",
|
||||
@ -199,7 +200,10 @@ warn_unreachable = true
|
||||
warn_unused_ignores = true
|
||||
|
||||
[tool.pytest]
|
||||
addopts = [ "-ra", "--color=auto" ]
|
||||
addopts = [ "-ra", "--color=auto", "--numprocesses=auto", "--dist=loadscope" ]
|
||||
markers = [
|
||||
"isolated: tests that are not compatible with pytest-xdist (deselect with '-m \"not isolated\"')",
|
||||
]
|
||||
testpaths = [
|
||||
"Tests",
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user