Verified Commit 2e934e33 authored by Adrian DC's avatar Adrian DC
Browse files

test(platform): improve coverage for Windows target

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent b7ac32d9
Loading
Loading
Loading
Loading
+2 −2
Changes for .gitlab-ci.yml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ coverage:linux:
      artifacts: false
      optional: true
  variables:
    COVERAGE_EXCLUDE_ALSO: 'pragma: windows cover'
    COVERAGE_EXCLUDE_ALSO: 'pragma: macos cover|pragma: windows cover'
    COVERAGE_FILE: ${CI_PROJECT_DIR}/coverage-reports/.coverage-linux
    COVERAGE_XML: ${CI_PROJECT_DIR}/coverage-reports/coverage-linux.xml

@@ -682,7 +682,7 @@ coverage:windows:
      optional: true
  variables:
    COVERAGE_FILE: ${CI_PROJECT_DIR}/coverage-reports/.coverage-windows
    COVERAGE_EXCLUDE_ALSO: 'pragma: linux cover'
    COVERAGE_EXCLUDE_ALSO: 'pragma: linux cover|pragma: macos cover'
    COVERAGE_XML: ${CI_PROJECT_DIR}/coverage-reports/coverage-windows.xml
    SUITE: 'versions\|windows'

+4 −4
Changes for src/system/platform.py: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ class Platform:
        home: None | Path = None

        # Elevated home
        if Platform.IS_USER_SUDO:
        if Platform.IS_USER_SUDO: # pragma: linux cover
            home = Path(expanduser(f'~{Platform.USER_SUDO}'))
            if not access(home, R_OK): # pragma: no cover
                home = None
@@ -63,12 +63,12 @@ class Platform:
            home = Path.home()

        # Windows userspace
        if Platform.IS_WINDOWS:
        if Platform.IS_WINDOWS: # pragma: windows cover
            return home / 'AppData' / 'Local' / name

        # macOS userspace
        if Platform.IS_MAC_OS:
        if Platform.IS_MAC_OS: # pragma: macos cover
            return home / 'Library' / 'Preferences' / name

        # Linux userspace
        return home / '.config' / name
        return home / '.config' / name # pragma: linux cover