Skip to content
Permalink
Browse files

Switch to pytest

  • Loading branch information...
Thrameos committed May 22, 2019
1 parent 1049739 commit 30e3c426620634d5748ed6e26142ff18a8be03b6
Showing with 92 additions and 213 deletions.
  1. +8 −8 .travis.yml
  2. +38 −37 appveyor.yml
  3. +2 −1 appveyor/install.ps1
  4. +3 −2 appveyor/install.sh
  5. +2 −2 appveyor/runTestsuite.ps1
  6. +4 −10 appveyor/runTestsuite.sh
  7. +1 −1 appveyor/upload.ps1
  8. 0 test/testConvert.py → examples/inspectConvert.py
  9. 0 {test → examples}/stubs/README
  10. 0 {test → examples}/stubs/buf_leak_test.py
  11. 0 {test → examples}/stubs/buf_leak_test3.py
  12. 0 {test → examples}/stubs/bulletproof.py
  13. 0 {test → examples}/stubs/convtest.py
  14. 0 {test → examples}/stubs/findjvm.py
  15. 0 {test → examples}/stubs/java_dom.py
  16. 0 {test → examples}/stubs/java_sax.py
  17. 0 {test → examples}/stubs/lists_and_maps.py
  18. 0 {test → examples}/stubs/python_dom.py
  19. 0 {test → examples}/stubs/test_awt.py
  20. 0 {test → examples}/stubs/test_jarray_fixes.py
  21. 0 {test → examples}/stubs/testlucene.py
  22. +0 −17 jpype/awt/__init__.py
  23. +0 −27 jpype/awt/event/WindowAdapter.py
  24. +0 −17 jpype/awt/event/__init__.py
  25. +1 −1 setup.py
  26. +0 −57 test/jpypetest/__init__.py
  27. +1 −1 test/jpypetest/{array.py → test_array.py}
  28. +1 −1 test/jpypetest/{attr.py → test_attr.py}
  29. +1 −1 test/jpypetest/{boxed.py → test_boxed.py}
  30. +1 −1 test/jpypetest/{closeable.py → test_closeable.py}
  31. +1 −1 test/jpypetest/{closed.py → test_closed.py}
  32. +1 −1 test/jpypetest/{collection.py → test_collection.py}
  33. +1 −1 test/jpypetest/{conversionBoolean.py → test_conversionBoolean.py}
  34. +1 −1 test/jpypetest/{conversionByte.py → test_conversionByte.py}
  35. +1 −1 test/jpypetest/{conversionDouble.py → test_conversionDouble.py}
  36. +1 −1 test/jpypetest/{conversionFloat.py → test_conversionFloat.py}
  37. +1 −1 test/jpypetest/{conversionInt.py → test_conversionInt.py}
  38. +1 −1 test/jpypetest/{conversionLong.py → test_conversionLong.py}
  39. +1 −1 test/jpypetest/{conversionShort.py → test_conversionShort.py}
  40. +1 −1 test/jpypetest/{exc.py → test_exc.py}
  41. +1 −1 test/jpypetest/{forname.py → test_forname.py}
  42. +1 −1 test/jpypetest/{imports.py → test_imports.py}
  43. 0 test/jpypetest/{jvmfinder.py → test_jvmfinder.py}
  44. +1 −1 test/jpypetest/{lambdas.py → test_lambdas.py}
  45. 0 test/jpypetest/{leak.py → test_leak.py}
  46. +1 −1 test/jpypetest/{mro.py → test_mro.py}
  47. +1 −1 test/jpypetest/{numeric.py → test_numeric.py}
  48. +1 −1 test/jpypetest/{objectwrapper.py → test_objectwrapper.py}
  49. +1 −1 test/jpypetest/{overloads.py → test_overloads.py}
  50. +1 −1 test/jpypetest/{properties.py → test_properties.py}
  51. +1 −1 test/jpypetest/{proxy.py → test_proxy.py}
  52. +1 −1 test/jpypetest/{proxy_multithreaded.py → test_proxy_multithreaded.py}
  53. +1 −1 test/jpypetest/{ref.py → test_ref.py}
  54. +1 −1 test/jpypetest/{reflect.py → test_reflect.py}
  55. +1 −1 test/jpypetest/{serial.py → test_serial.py}
  56. +1 −1 test/jpypetest/{startup.py → test_startup.py}
  57. +1 −1 test/jpypetest/{synchronized.py → test_synchronized.py}
  58. +1 −1 test/jpypetest/{thread.py → test_thread.py}
  59. +1 −1 test/jpypetest/{utf8.py → test_utf8.py}
  60. +1 −1 test/jpypetest/{values.py → test_values.py}
  61. +1 −1 test/jpypetest/{varargs.py → test_varargs.py}
@@ -4,15 +4,15 @@ os:
language: python

python:
- '2.6'
#- '2.6'
- '2.7'
- '3.3'
- '3.4'
- '3.5'
#- '3.3'
#- '3.4'
#- '3.5'
- '3.6'
- 'pypy'
- 'pypy3'
- "nightly"
#- 'pypy'
#- 'pypy3'
#- "nightly"

addons:
apt:
@@ -47,4 +47,4 @@ install:

script:
- python -c "import jpype"
- python test/testsuite.py
- pytest test/jpypetest
@@ -59,44 +59,45 @@ environment:
ARCH: x86
CONDA_PY: "3-latest"

- PYTHON: "C:\\Miniconda3-x64"
CONDA_PY: "3-latest"
ARCH: x86_64

### Dropping 3.4 build due to problem with setuptools
#- PYTHON: "C:\\Miniconda34-x64"
#CONDA_PY: "3.4.3"
#ARCH: x86_64
#
#- PYTHON: "C:\\Miniconda34"
#CONDA_PY: "3.4.3"
#ARCH: x86

- PYTHON: "C:\\Miniconda35-x64"
CONDA_PY: "3.5.2"
ARCH: x86_64

- PYTHON: "C:\\Miniconda35"
CONDA_PY: "3.5.2"
ARCH: x86

- PYTHON: "C:\\Miniconda36-x64"
CONDA_PY: "3.6.5"
ARCH: x86_64

- PYTHON: "C:\\Miniconda36"
CONDA_PY: "3.6.5"
ARCH: x86

- PYTHON: "C:\\Miniconda37-x64"
CONDA_PY: "3.7"
ARCH: x86_64

- PYTHON: "C:\\Miniconda37"
CONDA_PY: "3.7"
ARCH: x86
# Limit run for debugging
# - PYTHON: "C:\\Miniconda3-x64"
# CONDA_PY: "3-latest"
# ARCH: x86_64
#
# ### Dropping 3.4 build due to problem with setuptools
# #- PYTHON: "C:\\Miniconda34-x64"
# #CONDA_PY: "3.4.3"
# #ARCH: x86_64
# #
# #- PYTHON: "C:\\Miniconda34"
# #CONDA_PY: "3.4.3"
# #ARCH: x86
#
# - PYTHON: "C:\\Miniconda35-x64"
# CONDA_PY: "3.5.2"
# ARCH: x86_64
#
# - PYTHON: "C:\\Miniconda35"
# CONDA_PY: "3.5.2"
# ARCH: x86
#
# - PYTHON: "C:\\Miniconda36-x64"
# CONDA_PY: "3.6.5"
# ARCH: x86_64
#
# - PYTHON: "C:\\Miniconda36"
# CONDA_PY: "3.6.5"
# ARCH: x86
#
# - PYTHON: "C:\\Miniconda37-x64"
# CONDA_PY: "3.7"
# ARCH: x86_64
#
# - PYTHON: "C:\\Miniconda37"
# CONDA_PY: "3.7"
# ARCH: x86

install:
#install:
# Force java to be installed where JAVA_HOME points
# We can install and test multiple versions of java here
# - We will have to move the JAVA_HOME and the build of the harness to the test section.
@@ -9,7 +9,8 @@ python.exe -c "import struct; print(struct.calcsize('P') * 8)"
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
pip.exe install nose setuptools -r test-requirements.txt
pip.exe install setuptools -r test-requirements.txt
pip.exe install pytest==4.5.0
#pip.exe install -r "test-requirements.txt" # -r dev-requirements.txt

ant.exe -f test\\build.xml
@@ -31,7 +31,7 @@ fi
echo "==== update gcc"
$SETUP -q -P gcc-core,gcc-g++,libcrypt-devel
echo "==== update python"
$SETUP -q -P $PYTHON,$PYTHON-numpy,$PYTHON-devel,$PYTHON,$PYTHON-setuptools,$PYTHON-nose
$SETUP -q -P $PYTHON,$PYTHON-numpy,$PYTHON-devel,$PYTHON,$PYTHON-setuptools
echo "==== get modules"
$EASYINSTALL pip
$EASYINSTALL mock
@@ -47,8 +47,9 @@ git clone --depth=1 https://github.com/pypa/wheel.git
git clone --depth=1 https://github.com/pypa/pip.git
git clone --depth=1 https://github.com/pypa/setuptools_scm.git


$PYTHON -m pip install --upgrade ./pip ./wheel ./setuptools_scm
$PYTHON -m pip install pytest==4.5.0

rm -r ./pip ./wheel ./setuptools_scm

# Check versions
@@ -1,7 +1,7 @@
cd $env:APPVEYOR_BUILD_FOLDER
nosetests test/jpypetest --all-modules --with-xunit
python.exe -m pytest -v --junitxml=junit.xml test/jpypetest
$success = $?
Write-Host "result code of nosetests:" $success
Write-Host "result code of pytest:" $success

# return exit code of testsuite
if ( -not $success) {
@@ -1,20 +1,14 @@
export PATH="/bin:/usr/bin:$PATH"
cd $APPVEYOR_BUILD_FOLDER

if [ $PYTHON = "python3" ]; then
NOSETESTS="nosetests-3.6"
else
NOSETESTS="nosetests-2.7"
fi

echo "==== Run test.jpypetest"
$NOSETESTS -v --with-xunit --all-modules -s test.jpypetest
$PYTHON -m pytest -v --junitxml=junit.xml test/jpypetest

status=$?
echo "result code of nosetests:" $status
echo "result code of pytest:" $status

# Even if the nose gave a 0, we better have a result to upload.
if [ ! -e nosetests.xml ]; then
# Even if the pytest gave a 0, we better have a result to upload.
if [ ! -e junit.xml ]; then
exit -1
fi

@@ -23,7 +23,7 @@ function upload($file) {
function run {
cd $env:APPVEYOR_BUILD_FOLDER
$stylesheet = "test/transform_xunit_to_appveyor.xsl"
$input = "nosetests.xml"
$input = "junit.xml"
$output = "test/transformed.xml"

xslt_transform $input $stylesheet $output
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -35,7 +35,7 @@
'Programming Language :: Python :: 3.6',
],
packages=[
'jpype', 'jpype.awt', 'jpype.awt.event', 'jpypex', 'jpypex.swing'],
'jpype', 'jpypex', 'jpypex.swing'],
package_dir={
'jpype': 'jpype',
'jpypex': 'jpypex',

This file was deleted.

@@ -21,7 +21,7 @@
import sys
import jpype
from jpype import JPackage, JArray, JByte, java, JClass
from . import common
import common

if sys.version > '3':
unicode = str
@@ -18,7 +18,7 @@
from jpype import JString, java, JArray, JClass
import sys
import time
from . import common
import common


class AttributeTestCase(common.JPypeTestCase):
@@ -20,7 +20,7 @@
import unittest
import sys
import jpype
from . import common
import common

# Python2/3 support
if sys.version > '3':
@@ -19,7 +19,7 @@
except ImportError:
import unittest
import jpype
from . import common
import common
import sys


@@ -1,6 +1,6 @@
import unittest
import jpype
from . import common
import common

# jpype.startJVM(jpype.getDefaultJVMPath())

@@ -1,5 +1,5 @@
import jpype
from . import common
import common

try:
import unittest2 as unittest
@@ -18,7 +18,7 @@
import sys
import logging
import time
from . import common
import common
try:
import unittest2 as unittest
except ImportError:
@@ -18,7 +18,7 @@
import sys
import logging
import time
from . import common
import common
try:
import unittest2 as unittest
except ImportError:
@@ -18,7 +18,7 @@
import sys
import logging
import time
from . import common
import common
try:
import unittest2 as unittest
except ImportError:

0 comments on commit 30e3c42

Please sign in to comment.
You can’t perform that action at this time.