Skip to content

Commit 8f2498a

Browse files
committed
Consolidate convert_path tests and just generate the expected value in a platform-sensitive way. Should fix failures on mingw.
1 parent 8cada19 commit 8f2498a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

distutils/tests/test_util.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,10 @@ def test_get_platform(self):
6363
with mock.patch.dict('os.environ', {'VSCMD_ARG_TGT_ARCH': 'arm64'}):
6464
assert get_platform() == 'win-arm64'
6565

66-
@pytest.mark.skipif('platform.system() == "Windows"')
67-
def test_convert_path_unix(self):
68-
assert convert_path('/home/to/my/stuff') == '/home/to/my/stuff'
69-
assert convert_path(pathlib.Path('/home/to/my/stuff')) == '/home/to/my/stuff'
70-
assert convert_path('.') == os.curdir
71-
72-
@pytest.mark.skipif('platform.system() != "Windows"')
73-
def test_convert_path_windows(self):
74-
assert convert_path('/home/to/my/stuff') == r'\home\to\my\stuff'
75-
assert convert_path(pathlib.Path('/home/to/my/stuff')) == r'\home\to\my\stuff'
66+
def test_convert_path(self):
67+
expected = os.sep.join(('', 'home', 'to', 'my', 'stuff'))
68+
assert convert_path('/home/to/my/stuff') == expected
69+
assert convert_path(pathlib.Path('/home/to/my/stuff')) == expected
7670
assert convert_path('.') == os.curdir
7771

7872
def test_change_root(self):

0 commit comments

Comments
 (0)