File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change 1- import getpass
21import logging
32import os
43import pathlib
2221USING_ZSH = "zsh" in os .getenv ("SHELL" , "" )
2322
2423
25- @pytest .fixture (autouse = True , scope = "session" )
26- def home_path (tmp_path_factory : pytest .TempPathFactory ):
27- return tmp_path_factory .mktemp ("home" )
28-
29-
30- @pytest .fixture (autouse = True , scope = "session" )
31- def user_path (home_path : pathlib .Path ):
32- p = home_path / getpass .getuser ()
33- p .mkdir ()
34- return p
35-
36-
3724@pytest .mark .skipif (USING_ZSH , reason = "Using ZSH" )
3825@pytest .fixture (autouse = USING_ZSH , scope = "session" )
3926def zshrc (user_path : pathlib .Path ):
@@ -47,8 +34,8 @@ def zshrc(user_path: pathlib.Path):
4734
4835
4936@pytest .fixture (autouse = True )
50- def home_path_default (user_path : pathlib .Path ):
51- os . environ [ "HOME" ] = str (user_path )
37+ def home_path_default (monkeypatch : pytest . MonkeyPatch , user_path : pathlib .Path ) -> None :
38+ monkeypatch . setenv ( "HOME" , str (user_path ) )
5239
5340
5441@pytest .fixture (scope = "function" )
You can’t perform that action at this time.
0 commit comments