Skip to content

Commit 2a4cf68

Browse files
committed
Fixing slashes for windows tests
1 parent bedc1a7 commit 2a4cf68

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ jobs:
2727
- name: Set temp directories on Windows
2828
if: matrix.os == 'windows-latest'
2929
run: |
30-
echo $env:USERPROFILE
31-
echo $env:GITHUB_ENV
3230
echo "TMPDIR=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
3331
echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
3432
echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
35-
echo $env:GITHUB_ENV
3633
- name: Install dependencies
3734
run: |
3835
git config --global user.email "[email protected]"

tests/test_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,15 @@ def test_has_git_false(self) -> None:
5959

6060
def test_get_git_root(self) -> None:
6161
# Ideally should be self.temp_dir.name == get_git_root() but the OS may add a prefix like /private
62-
print(f'git root: {get_git_root()}')
63-
print(f'temp dir: {self.temp_dir.name}')
64-
self.assertTrue(get_git_root().endswith(self.temp_dir.name))
62+
self.assertTrue(get_git_root().endswith(self.temp_dir.name.replace('\\', '/')))
6563

6664
def test_get_git_root_subdir(self) -> None:
6765
subdir = os.path.join(self.temp_dir.name, 'subdir')
6866
os.makedirs(subdir)
6967
os.chdir(subdir)
7068

7169
# Ideally should be self.temp_dir.name == get_git_root() but the OS may add a prefix like /private
72-
self.assertTrue(get_git_root().endswith(self.temp_dir.name))
70+
self.assertTrue(get_git_root().endswith(self.temp_dir.name.replace('\\', '/')))
7371

7472
os.chdir(self.temp_dir.name)
7573

0 commit comments

Comments
 (0)