Skip to content

Commit

Permalink
Use Pytest's skipif decorator instead of returning to skip assert sta…
Browse files Browse the repository at this point in the history
…tements.
  • Loading branch information
Dos Moonen committed Apr 13, 2022
1 parent 259dba4 commit 555b6d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/util/test_platform.py
@@ -1,3 +1,4 @@
import pytest
import platform

from keyring.util.platform_ import (
Expand All @@ -10,19 +11,17 @@
)


@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

0 comments on commit 555b6d2

Please sign in to comment.