Skip to content

Commit 32bde8f

Browse files
committed
Fix tests on windows
1 parent 63e8549 commit 32bde8f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

Lib/test/test_pstats.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
from os.path import join
23

34
from test import support
45
from io import StringIO
@@ -126,36 +127,36 @@ def test_needs_no_minimizing(self):
126127
def test_normal_case(self):
127128
self.assertEqual(
128129
_build_minimal_path_by_full_path([
129-
'foo/bar',
130-
'baz/bar',
131-
'apple/orange',
130+
join('foo', 'bar'),
131+
join('baz', 'bar'),
132+
join('apple', 'orange'),
132133
]),
133134
{
134-
'foo/bar': 'foo/bar',
135-
'baz/bar': 'baz/bar',
136-
'apple/orange': 'orange',
135+
join('foo', 'bar'): join('foo', 'bar'),
136+
join('baz', 'bar'): join('baz', 'bar'),
137+
join('apple', 'orange'): 'orange',
137138
}
138139
)
139140

140141
def test_intermediate(self):
141142
self.assertEqual(
142143
_build_minimal_path_by_full_path([
143-
'apple/mango/orange/grape/melon',
144-
'apple/mango/lemon/grape/melon',
144+
join('apple', 'mango', 'orange', 'grape', 'melon'),
145+
join('apple', 'mango', 'lemon', 'grape', 'melon'),
145146
]),
146147
{
147-
'apple/mango/orange/grape/melon': 'orange/grape/melon',
148-
'apple/mango/lemon/grape/melon': 'lemon/grape/melon',
148+
join('apple', 'mango', 'orange', 'grape', 'melon'): join('orange', 'grape', 'melon'),
149+
join('apple', 'mango', 'lemon', 'grape', 'melon'): join('lemon', 'grape', 'melon'),
149150
}
150151
)
151152

152153
def test_dunder_init_special_case(self):
153154
self.assertEqual(
154155
_build_minimal_path_by_full_path([
155-
'apple/mango/orange/grape/__init__.py',
156+
join('apple', 'mango', 'orange', 'grape', '__init__.py'),
156157
]),
157158
{
158-
'apple/mango/orange/grape/__init__.py': 'grape/__init__.py',
159+
join('apple', 'mango', 'orange', 'grape', '__init__.py'): join('grape', '__init__.py'),
159160
}
160161
)
161162

0 commit comments

Comments
 (0)