From eae4f2232d46627649e36f127516570f4e7cf23f Mon Sep 17 00:00:00 2001 From: Gabriel Pettier Date: Thu, 5 Dec 2019 23:57:13 +0100 Subject: [PATCH] switch from nose to pytest --- .github/workflows/push.yml | 6 +++--- Makefile | 6 +++--- setup.py | 2 +- tests/test_proxy.py | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b8141278..b959aa5f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 diff --git a/Makefile b/Makefile index 74954a30..bc20867c 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/setup.py b/setup.py index dda0a51a..04d25b1f 100644 --- a/setup.py +++ b/setup.py @@ -120,7 +120,7 @@ def compile_native_invocation_handler(*possible_homes): ) ], extras_require={ - 'dev': ['nose', 'wheel', 'pytest-cov', 'pycodestyle'], + 'dev': ['pytest', 'wheel', 'pytest-cov', 'pycodestyle'], 'ci': ['coveralls', 'pytest-rerunfailures', 'setuptools>=34.4.0'], }, **SETUP_KWARGS diff --git a/tests/test_proxy.py b/tests/test_proxy.py index 55bdc584..0e8dc793 100644 --- a/tests/test_proxy.py +++ b/tests/test_proxy.py @@ -5,7 +5,6 @@ import sys from jnius import autoclass, java_method, PythonJavaClass, cast -from nose.tools import * print('1: declare a TestImplem that implement Collection')