We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b48e23d commit 2e39fd8Copy full SHA for 2e39fd8
src/_pytest/tmpdir.py
@@ -2,6 +2,7 @@
2
from __future__ import absolute_import, division, print_function
3
4
import re
5
+from six.moves import reduce
6
7
import pytest
8
import py
@@ -24,13 +25,14 @@ def parse_num(p, cut=len(l_prefix)):
24
25
26
for i in range(10):
27
# try up to 10 times to create the folder
- max_existing = max(
28
+ max_existing = reduce(
29
+ max,
30
(
31
parse_num(x)
32
for x in root.iterdir()
33
if x.name.lower().startswith(l_prefix)
34
),
- default=-1,
35
+ -1,
36
)
37
new_number = max_existing + 1
38
new_path = root.joinpath("{}{}".format(prefix, new_number))
0 commit comments