66from click .testing import CliRunner
77
88from sphinxcontrib .versioning .__main__ import cli
9+ from sphinxcontrib .versioning .git import IS_WINDOWS
910
1011
1112@pytest .fixture (autouse = True )
@@ -106,7 +107,10 @@ def test_global_options(monkeypatch, tmpdir, caplog, local_empty, run, push):
106107 result = CliRunner ().invoke (cli , args )
107108 config = result .exception .args [0 ]
108109 assert config .chdir == str (local_empty )
109- assert config .git_root == str (local_empty )
110+ if IS_WINDOWS :
111+ assert config .git_root .lower () == str (local_empty ).lower ()
112+ else :
113+ assert config .git_root == str (local_empty )
110114 assert config .local_conf is None
111115 assert config .no_colors is False
112116 assert config .no_local_conf is False
@@ -121,7 +125,10 @@ def test_global_options(monkeypatch, tmpdir, caplog, local_empty, run, push):
121125 result = CliRunner ().invoke (cli , args )
122126 config = result .exception .args [0 ]
123127 assert config .chdir == str (empty )
124- assert config .git_root == str (repo )
128+ if IS_WINDOWS :
129+ assert config .git_root .lower () == str (repo ).lower ()
130+ else :
131+ assert config .git_root == str (repo )
125132 assert config .local_conf is None # Overridden by -L.
126133 assert config .no_colors is True
127134 assert config .no_local_conf is True
@@ -141,7 +148,10 @@ def test_global_options(monkeypatch, tmpdir, caplog, local_empty, run, push):
141148 records = [(r .levelname , r .message ) for r in caplog .records ]
142149 config = result .exception .args [0 ]
143150 assert config .chdir == str (local_empty )
144- assert config .git_root == str (local_empty )
151+ if IS_WINDOWS :
152+ assert config .git_root .lower () == str (local_empty ).lower ()
153+ else :
154+ assert config .git_root == str (local_empty )
145155 assert config .local_conf == join ('docs' , 'conf.py' )
146156 assert config .no_colors is True
147157 assert config .no_local_conf is False
0 commit comments