Use pytest instead of the deprecated nose test runner
This commit is contained in:
parent
6cc5652a9a
commit
fc26ff2688
1 changed files with 3 additions and 30 deletions
|
|
@ -60,7 +60,7 @@ BuildRequires: yara-devel >= %{version}
|
|||
BuildRequires: /usr/bin/sphinx-build
|
||||
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-nose
|
||||
BuildRequires: python%{python3_pkgversion}-pytest
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||
|
||||
|
||||
|
|
@ -132,40 +132,13 @@ Summary: Python2 binding for the YARA pattern matching tool
|
|||
%check
|
||||
%if 0%{?with_check}
|
||||
# ==============================================================================
|
||||
# Tests for python3 used to always fail on testModuleData testcase
|
||||
# Tests for python3 used to randomly fail on testCompare testcase
|
||||
# reported to upstream - https://github.com/VirusTotal/yara-python/issues/21
|
||||
# temporarily run the failing tests but ignore the results for those 2
|
||||
# EXCLUDE='--exclude=^testCompare$|^testModuleData$'
|
||||
# seems to be fixed in 3.9.0
|
||||
EXCLUDE='--exclude=^nothing$'
|
||||
|
||||
# Yara is not prepared to run on s390 - more tests failing on s390
|
||||
# http://s390.koji.fedoraproject.org/kojifiles/work/tasks/9135/2399135/build.log
|
||||
# https://github.com/VirusTotal/yara-python/issues/25
|
||||
# 3.6.3 - testCompileFile started failing - https://kojipkgs.fedoraproject.org//work/tasks/9619/20589619/build.log
|
||||
# https://github.com/VirusTotal/yara-python/issues/54
|
||||
# seems to be fixed in 3.9.0
|
||||
%ifarch s390 s390x %{power64}
|
||||
# EXCLUDE='--exclude=^testCompare$|^testModuleData$|^testEntrypoint$|^testIn$|^testIntegerFunctions$|^testCompileFile$'
|
||||
EXCLUDE='--exclude=^nothing$'
|
||||
%endif
|
||||
|
||||
# 3.9.0 - testModuleData is always failing for architecture armv7hl
|
||||
%ifarch armv7hl
|
||||
EXCLUDE='--exclude=^testModuleData$'
|
||||
EXCLUDE='not testModuleData'
|
||||
%endif
|
||||
|
||||
|
||||
# Find the NOSETEST binary or use false if not present
|
||||
NOSETESTS3=`ls /usr/bin/nosetests-3.* || which false `
|
||||
PYTHONPATH=%{buildroot}/%{python3_sitearch}/ "$NOSETESTS3" -v "$EXCLUDE"
|
||||
|
||||
# Run potentially ignored tests separately so we can at least see the results
|
||||
PYTHONPATH=%{buildroot}/%{python3_sitearch}/ "$NOSETESTS3" -v ./tests.py:TestYara.testCompare \
|
||||
./tests.py:TestYara.testModuleData ./tests.py:TestYara.testEntrypoint \
|
||||
./tests.py:TestYara.testIn ./tests.py:TestYara.testIntegerFunctions \
|
||||
./tests.py:TestYara.testCompileFile || true
|
||||
%pytest -k "$EXCLUDE" tests.py -v
|
||||
|
||||
# with_check
|
||||
%endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue