[tests] add somewhat experimental import-time tests
add auto-generated tests that check that a given module can be imported, if all prerequisites are followed. see #641
This commit is contained in:
parent
9be1331e1b
commit
548ccc5e94
94 changed files with 624 additions and 2 deletions
7
tests/modules/core/test_cpu.py
Normal file
7
tests/modules/core/test_cpu.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.cpu")
|
||||
|
5
tests/modules/core/test_date.py
Normal file
5
tests/modules/core/test_date.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.date")
|
||||
|
7
tests/modules/core/test_datetime.py
Normal file
7
tests/modules/core/test_datetime.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.datetime")
|
||||
|
5
tests/modules/core/test_debug.py
Normal file
5
tests/modules/core/test_debug.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.debug")
|
||||
|
5
tests/modules/core/test_disk.py
Normal file
5
tests/modules/core/test_disk.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.disk")
|
||||
|
5
tests/modules/core/test_error.py
Normal file
5
tests/modules/core/test_error.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.error")
|
||||
|
7
tests/modules/core/test_git.py
Normal file
7
tests/modules/core/test_git.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("pygit2")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.git")
|
||||
|
7
tests/modules/core/test_layout-xkb.py
Normal file
7
tests/modules/core/test_layout-xkb.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("xkbgroup")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.layout-xkb")
|
||||
|
7
tests/modules/core/test_load.py
Normal file
7
tests/modules/core/test_load.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("multiprocessing")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.load")
|
||||
|
5
tests/modules/core/test_memory.py
Normal file
5
tests/modules/core/test_memory.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.memory")
|
||||
|
9
tests/modules/core/test_nic.py
Normal file
9
tests/modules/core/test_nic.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("netifaces")
|
||||
|
||||
pytest.importorskip("subprocess")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.nic")
|
||||
|
5
tests/modules/core/test_pasink.py
Normal file
5
tests/modules/core/test_pasink.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pasink")
|
||||
|
5
tests/modules/core/test_pasource.py
Normal file
5
tests/modules/core/test_pasource.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pasource")
|
||||
|
5
tests/modules/core/test_ping.py
Normal file
5
tests/modules/core/test_ping.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.ping")
|
||||
|
5
tests/modules/core/test_pulseaudio.py
Normal file
5
tests/modules/core/test_pulseaudio.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pulseaudio")
|
||||
|
5
tests/modules/core/test_redshift.py
Normal file
5
tests/modules/core/test_redshift.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.redshift")
|
||||
|
5
tests/modules/core/test_sensors2.py
Normal file
5
tests/modules/core/test_sensors2.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.sensors2")
|
||||
|
5
tests/modules/core/test_spacer.py
Normal file
5
tests/modules/core/test_spacer.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.spacer")
|
||||
|
7
tests/modules/core/test_speedtest.py
Normal file
7
tests/modules/core/test_speedtest.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("speedtest")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.speedtest")
|
||||
|
5
tests/modules/core/test_test.py
Normal file
5
tests/modules/core/test_test.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.test")
|
||||
|
5
tests/modules/core/test_time.py
Normal file
5
tests/modules/core/test_time.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.time")
|
||||
|
7
tests/modules/core/test_vault.py
Normal file
7
tests/modules/core/test_vault.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.vault")
|
||||
|
9
tests/modules/core/test_xrandr.py
Normal file
9
tests/modules/core/test_xrandr.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("bumblebee_status.discover")
|
||||
|
||||
pytest.importorskip("i3")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.xrandr")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue