Skip to content

Commit 5746912

Browse files
author
Christopher Doris
committed
skip some tests in CI if using system python
1 parent 3c47839 commit 5746912

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

test/Compat.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "gui" begin
1+
@testitem "gui" setup=[Setup] begin
22
@testset "fix_qt_plugin_path" begin
33
@test PythonCall.fix_qt_plugin_path() isa Bool
44
# second time is a no-op
@@ -7,7 +7,7 @@
77
@testset "event_loop_on/off" begin
88
@testset "$g" for g in [:pyqt4, :pyqt5, :pyside, :pyside2, :pyside6, :gtk, :gtk3, :wx]
99
# TODO: actually test the various GUIs somehow?
10-
if g == :pyside6
10+
if Setup.devdeps && g == :pyside6
1111
# pyside6 is installed as a dev dependency
1212
# AND it's a dependency of matplotlib, which is also a dev dependency
1313
@test PythonCall.event_loop_on(g) isa Timer
@@ -18,8 +18,10 @@
1818
end
1919
end
2020
@testset "matplotlib issue 676" begin
21-
plt = pyimport("matplotlib.pyplot")
22-
@test plt.get_backend() isa Py
21+
if Setup.devdeps
22+
plt = pyimport("matplotlib.pyplot")
23+
@test plt.get_backend() isa Py
24+
end
2325
end
2426
end
2527

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
using TestItemRunner
22

3+
@testmodule Setup begin
4+
# test if we are in CI
5+
ci = get(ENV, "CI", "") == "true"
6+
# test if we have all dev conda deps (assume true if not in CI)
7+
devdeps = ci ? ENV["JULIA_PYTHONCALL_EXE"] == "@CondaPkg" : true
8+
end
9+
310
@run_package_tests

0 commit comments

Comments
 (0)