Skip to content

Commit 06c6f13

Browse files
committed
add pytest-6.2.patch
1 parent f0da0e0 commit 06c6f13

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py
2+
index 4230693..1c9bab8 100644
3+
--- a/src/_pytest/_code/code.py
4+
+++ b/src/_pytest/_code/code.py
5+
@@ -248,15 +248,17 @@ class TracebackEntry:
6+
if key is not None:
7+
astnode = astcache.get(key, None)
8+
start = self.getfirstlinesource()
9+
- try:
10+
- astnode, _, end = getstatementrange_ast(
11+
- self.lineno, source, astnode=astnode
12+
- )
13+
- except SyntaxError:
14+
- end = self.lineno + 1
15+
- else:
16+
- if key is not None:
17+
- astcache[key] = astnode
18+
+ end = -1
19+
+ # GraalPython: no support for the ast module so the source cannot be retrieved correctly
20+
+ # try:
21+
+ # astnode, _, end = getstatementrange_ast(
22+
+ # self.lineno, source, astnode=astnode
23+
+ # )
24+
+ # except SyntaxError:
25+
+ # end = self.lineno + 1
26+
+ # else:
27+
+ # if key is not None:
28+
+ # astcache[key] = astnode
29+
return source[start:end]
30+
31+
source = property(getsource)
32+
diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py
33+
index a18cf19..bd7523c 100644
34+
--- a/src/_pytest/assertion/__init__.py
35+
+++ b/src/_pytest/assertion/__init__.py
36+
@@ -26,7 +26,8 @@ def pytest_addoption(parser: Parser) -> None:
37+
action="store",
38+
dest="assertmode",
39+
choices=("rewrite", "plain"),
40+
- default="rewrite",
41+
+ # default="rewrite",
42+
+ default="plain",
43+
metavar="MODE",
44+
help=(
45+
"Control assertion debugging tools.\n"
46+

0 commit comments

Comments
 (0)