forked from pool/python-pyftpdlib
Accepting request 856906 from home:bnavigator:branches:devel:languages:python
- add ignore _build directories to pytest args to fix builds for multiple pytest flavors gh#openSUSE/python-rpm-macros#66 - fix tests failing locally because of gh#giampaolo/pyftpdlib#478 OBS-URL: https://build.opensuse.org/request/show/856906 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyftpdlib?expand=0&rev=27
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 18 16:29:52 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- add ignore _build directories to pytest args to fix builds for
|
||||||
|
multiple pytest flavors gh#openSUSE/python-rpm-macros#66
|
||||||
|
- fix tests failing locally because of gh#giampaolo/pyftpdlib#478
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Aug 16 04:20:40 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
|
Sun Aug 16 04:20:40 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
|
||||||
|
|
||||||
|
@@ -69,10 +69,27 @@ write very asynchronous FTP servers with Python.
|
|||||||
# https://github.com/giampaolo/pyftpdlib/issues/386
|
# https://github.com/giampaolo/pyftpdlib/issues/386
|
||||||
# If they re-occur, please update the issue with backtraces,
|
# If they re-occur, please update the issue with backtraces,
|
||||||
# and disable only related tests.
|
# and disable only related tests.
|
||||||
export PYTHONPATH=$PWD
|
donttest="(TestFtpStoreDataTLSMixin and test_rest_on_stor)"
|
||||||
printf '[pytest]\naddopts = -rs -v -k "not (TestFtpStoreDataTLSMixin and test_rest_on_stor) and not (TestFtpStoreDataTLSMixin and test_stor_ascii)"' > pytest.ini
|
donttest+=" or (TestFtpStoreDataTLSMixin and test_stor_ascii)"
|
||||||
# %%pytest des not work. The tests parse CLI args and fail if there are any unknown program args
|
ignorebuild="--ignore build"
|
||||||
%python_exec -m pytest
|
%{python_expand # expand to python flavor, not to the binary name, then strip the trailing _
|
||||||
|
builddir=_build.$python_
|
||||||
|
ignorebuild+=" --ignore ${builddir%_}"
|
||||||
|
}
|
||||||
|
cat > pytest.ini <<EOF
|
||||||
|
[pytest]
|
||||||
|
addopts =
|
||||||
|
-rs -v
|
||||||
|
-k "not ($donttest)"
|
||||||
|
$ignorebuild
|
||||||
|
EOF
|
||||||
|
%{python_expand # pytest macro does not work. The tests parse CLI args and fail if there are any unknown program args
|
||||||
|
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
||||||
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
|
# https://github.com/giampaolo/pyftpdlib/issues/478
|
||||||
|
export TZ=GMT+1
|
||||||
|
$python -m pytest
|
||||||
|
}
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%python_install_alternative ftpbench
|
%python_install_alternative ftpbench
|
||||||
|
Reference in New Issue
Block a user