浏览代码

tests: Properly skip Pmw tests when tkinter is not present

rdb 1 年之前
父节点
当前提交
1a4ca179a9

+ 1 - 0
tests/test_imports.py

@@ -268,6 +268,7 @@ def test_imports_direct_net():
 
 
 def test_imports_tk():
+    pytest.importorskip('tkinter')
     Pmw = pytest.importorskip('Pmw')
 
     import direct.showbase.TkGlobal

+ 1 - 0
tests/tkpanels/test_ParticlePanel.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 Pmw = pytest.importorskip('Pmw')
 from direct.tkpanels.ParticlePanel import ParticlePanel
 

+ 1 - 0
tests/tkpanels/test_Placer.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 Pmw = pytest.importorskip('Pmw')
 from direct.showbase.ShowBase import ShowBase
 from direct.tkpanels.Placer import Placer

+ 1 - 0
tests/tkwidgets/test_AppShell.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 pytest.importorskip('Pmw')
 from direct.tkwidgets import AppShell
 

+ 1 - 0
tests/tkwidgets/test_EntryScale.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 pytest.importorskip('Pmw')
 from direct.tkwidgets.EntryScale import EntryScale, EntryScaleGroup
 

+ 1 - 0
tests/tkwidgets/test_Floater.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 pytest.importorskip('Pmw')
 from direct.tkwidgets.Floater import Floater, FloaterGroup
 

+ 1 - 0
tests/tkwidgets/test_VectorWidgets.py

@@ -1,4 +1,5 @@
 import pytest
+pytest.importorskip('tkinter')
 pytest.importorskip('Pmw')
 from direct.tkwidgets import VectorWidgets