switch from nose to pytest

This commit is contained in:
Gabriel Pettier 2019-12-05 23:57:13 +01:00
parent e685086aba
commit eae4f2232d
4 changed files with 7 additions and 8 deletions

View File

@ -76,21 +76,21 @@ jobs:
ant all
cd tests
nosetests -v
pytest -v
- name: test
if: matrix.os == 'ubuntu-latest'
run: |
ant all
cd tests
CLASSPATH=../build/test-classes:../build/classes nosetests -v
CLASSPATH=../build/test-classes:../build/classes pytest -v
- name: test
if: matrix.os == 'macOs-latest'
run: |
ant all
cd tests
CLASSPATH=../build/test-classes:../build/classes python -m nose -v
CLASSPATH=../build/test-classes:../build/classes python -m pytest -v
# - name: coveralls
# run: python -m coveralls

View File

@ -3,7 +3,7 @@ all: build_ext
.PHONY: build_ext tests
PYTHON=python
NOSETESTS=nosetests
PYTEST=pytest
JAVA_TARGET ?= $(shell $(PYTHON) -c "import re; print('1.6' if int(re.findall(r'\d+', '$(shell javac -version 2>&1)')[0]) < 12 else '1.7')" )
JAVAC_OPTS=-target $(JAVA_TARGET) -source $(JAVA_TARGET)
@ -13,7 +13,7 @@ ANT=ant -Dant.build.javac.source=$(JAVA_TARGET) -Dant.build.javac.target=$(JAVA_
build_ext:
$(ANT) all
$(PYTHON) setup.py build_ext --inplace -f -g
$(PYTHON) setup.py build_ext --inplace -g
clean:
$(ANT) clean
@ -25,4 +25,4 @@ html:
# for use in travis; tests whatever you got.
# use PYTHON3=1 to force python3 in other environments.
tests:
(cd tests; env CLASSPATH=../build/test-classes:../build/classes PYTHONPATH=..:$(PYTHONPATH) $(NOSETESTS) -v)
(cd tests; env CLASSPATH=../build/test-classes:../build/classes PYTHONPATH=..:$(PYTHONPATH) $(PYTEST) -v)

View File

@ -120,7 +120,7 @@ setup(
)
],
extras_require={
'dev': ['nose', 'wheel', 'pytest-cov', 'pycodestyle'],
'dev': ['pytest', 'wheel', 'pytest-cov', 'pycodestyle'],
'ci': ['coveralls', 'pytest-rerunfailures', 'setuptools>=34.4.0'],
},
**SETUP_KWARGS

View File

@ -5,7 +5,6 @@ from six.moves import range
import sys
from jnius import autoclass, java_method, PythonJavaClass, cast
from nose.tools import *
print('1: declare a TestImplem that implement Collection')