Skip to content

Commit ca6d989

Browse files
authored
Merge pull request tpaviot#930 from tpaviot/review/gui-tests
Review/gui tests
2 parents 8710ecf + 9562330 commit ca6d989

File tree

6 files changed

+21
-52
lines changed

6 files changed

+21
-52
lines changed

ci/conda/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ test:
4040
- pyqt >=5
4141
- mypy
4242
- svgwrite
43+
- wxpython >=4
44+
- pyside2 >=5
4345

4446
about:
4547
home: https://github.com/tpaviot/pythonocc-core

ci/conda/run_test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ mypy test_mypy_classic_occ_bottle.py
66
if [ $(uname) == Linux ]; then
77
# start xvfb
88
xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' python core_display_pyqt5_unittest.py
9-
fi
9+
xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' python core_display_pyside2_unittest.py
10+
xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' python core_display_wx_unittest.py
11+
fi

test/core_display_pyqt4_unittest.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

test/core_display_pyqt5_unittest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
##You should have received a copy of the GNU Lesser General Public License
1818
##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>.
1919

20-
from __future__ import print_function
2120
import sys
2221

2322
from OCC.Display.backend import load_pyqt5
@@ -29,7 +28,8 @@
2928
print("pyqt5 required to run this test")
3029
sys.exit()
3130

32-
print('pyqt5 test')
31+
print('pyqt5 test running ...')
3332
pyqt5_display, start_display, add_menu, add_function_to_menu = init_display('qt-pyqt5')
34-
my_box_1 = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
35-
pyqt5_display.DisplayShape(my_box_1, update=True)
33+
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
34+
pyqt5_display.DisplayShape(my_box, update=True)
35+
print('pyqt5 test ok.')
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
##You should have received a copy of the GNU Lesser General Public License
1818
##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>.
1919

20-
from __future__ import print_function
2120
import sys
2221

23-
from OCC.Display.backend import load_pyside
22+
from OCC.Display.backend import load_pyside2
2423
from OCC.Display.SimpleGui import init_display
2524
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
2625

2726
# check for pyside
28-
if not load_pyside():
29-
print("pyside required to run this test")
27+
if not load_pyside2():
28+
print("pyside2 required to run this test")
3029
sys.exit()
3130

32-
print('pyside test')
33-
pyside_display, start_display, add_menu, add_function_to_menu = init_display('qt-pyside')
34-
my_box_1 = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
35-
pyside_display.DisplayShape(my_box_1, update=True)
31+
print('pyside2 test running ...')
32+
pyside2_display, start_display, add_menu, add_function_to_menu = init_display('qt-pyside2')
33+
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
34+
pyside2_display.DisplayShape(my_box, update=True)
35+
print('pyside2 test ok.')

test/core_display_wx_unittest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
##You should have received a copy of the GNU Lesser General Public License
1818
##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>.
1919

20-
from __future__ import print_function
2120
import sys
2221

2322
from OCC.Display.backend import load_wx
@@ -29,7 +28,8 @@
2928
print("wx required to run this test")
3029
sys.exit()
3130

32-
print('wx test')
31+
print('wx test running ...')
3332
wx_display, start_display, add_menu, add_function_to_menu = init_display('wx')
34-
my_box_1 = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
35-
wx_display.DisplayShape(my_box_1, update=True)
33+
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
34+
wx_display.DisplayShape(my_box, update=True)
35+
print('wx test ok.')

0 commit comments

Comments
 (0)