Use Pytest's skipif decorator instead of returning to skip assert statements.
+import pytest
import platform
from keyring.util.platform_ import (
@@ -10,19 +11,21 @@ from keyring.util.platform_ import (
)
+@pytest.mark.skipif(
+ platform.system() != "Linux", reason="Requires platform.system() == 'Linux'"
+)
def test_platform_Linux():
# rely on the Github Actions workflow to run this on different platforms
- if platform.system() != "Linux":
- return
assert config_root == _config_root_Linux
assert data_root == _data_root_Linux
+@pytest.mark.skipif(
+ platform.system() != "Windows", reason="Requires platform.system() == 'Windows'"
+)
def test_platform_Windows():
# rely on the Github Actions workflow to run this on different platforms
- if platform.system() != "Windows":
- return
assert config_root == _config_root_Windows
assert data_root == _data_root_Windows
