File tree 1 file changed +2
-15
lines changed
1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change 1
- import getpass
2
1
import logging
3
2
import os
4
3
import pathlib
22
21
USING_ZSH = "zsh" in os .getenv ("SHELL" , "" )
23
22
24
23
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
-
37
24
@pytest .mark .skipif (USING_ZSH , reason = "Using ZSH" )
38
25
@pytest .fixture (autouse = USING_ZSH , scope = "session" )
39
26
def zshrc (user_path : pathlib .Path ):
@@ -47,8 +34,8 @@ def zshrc(user_path: pathlib.Path):
47
34
48
35
49
36
@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 ) )
52
39
53
40
54
41
@pytest .fixture (scope = "function" )
You can’t perform that action at this time.
0 commit comments