Skip to content

Commit

Permalink
Fix test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Aug 28, 2023
1 parent 92fc197 commit 7a4a4db
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/unit/test_config.py
@@ -1,5 +1,6 @@
import os
import sys
from pathlib import Path
from unittest import mock

import pytest
Expand All @@ -20,13 +21,13 @@ def _assert_config_read(environment, mock_config):
del os.environ[env_name]
os.environ[environment] = "/MOCK"

module_dir = os.path.dirname(sys.modules["praw"].__file__)
environ_path = os.path.join(
"/MOCK", ".config" if environment == "HOME" else "", "praw.ini"
module_dir = Path(sys.modules["praw"].__file__).parent
environ_path = (
Path("/MOCK") / (".config" if environment == "HOME" else "") / "praw.ini"
)
locations = [
os.path.join(module_dir, "praw.ini"),
environ_path,
str(module_dir / "praw.ini"),
str(environ_path),
"praw.ini",
]

Expand Down

0 comments on commit 7a4a4db

Please sign in to comment.