File tree 5 files changed +25
-10
lines changed
5 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,13 @@ install:
13
13
- pip install --upgrade --pre tox
14
14
env :
15
15
matrix :
16
+ - TOXENV=py27
16
17
# Specialized factors for py27.
17
- - TOXENV=py27-pexpect,py27-trial,py27-numpy
18
18
- TOXENV=py27-nobyte
19
19
- TOXENV=py27-xdist
20
20
- TOXENV=py27-pluggymaster PYTEST_NO_COVERAGE=1
21
21
# Specialized factors for py37.
22
22
- TOXENV=py37-pexpect,py37-trial,py37-numpy
23
- - TOXENV=py37-xdist
24
23
- TOXENV=py37-pluggymaster PYTEST_NO_COVERAGE=1
25
24
- TOXENV=py37-freeze PYTEST_NO_COVERAGE=1
26
25
30
29
- env : TOXENV=pypy PYTEST_NO_COVERAGE=1
31
30
python : ' pypy-5.4'
32
31
dist : trusty
32
+ - env : TOXENV=py34
33
+ python : ' 3.4'
33
34
- env : TOXENV=py35
34
35
python : ' 3.5'
36
+ - env : TOXENV=py36
37
+ python : ' 3.6'
35
38
- env : TOXENV=py37
36
39
- &test-macos
37
40
language : generic
50
53
- brew link python
51
54
52
55
- stage : baseline
53
- env : TOXENV=py27
54
- - env : TOXENV=py34
55
- python : ' 3.4'
56
- - env : TOXENV=py36
57
- python : ' 3.6'
56
+ env : TOXENV=py27-pexpect,py27-trial,py27-numpy
57
+ - env : TOXENV=py37-xdist
58
58
- env : TOXENV=linting,docs,doctesting
59
59
python : ' 3.7'
60
60
Original file line number Diff line number Diff line change 1
1
environment :
2
2
matrix :
3
+ - TOXENV : " py37-xdist"
4
+ - TOXENV : " py27-xdist"
3
5
- TOXENV : " py27"
4
6
- TOXENV : " py37"
5
7
- TOXENV : " linting,docs,doctesting"
@@ -12,14 +14,12 @@ environment:
12
14
- TOXENV : " py27-trial,py27-numpy,py27-nobyte"
13
15
- TOXENV : " py27-pluggymaster"
14
16
PYTEST_NO_COVERAGE : " 1"
15
- - TOXENV : " py27-xdist"
16
17
# Specialized factors for py37.
17
18
- TOXENV : " py37-trial,py37-numpy"
18
19
- TOXENV : " py37-pluggymaster"
19
20
PYTEST_NO_COVERAGE : " 1"
20
21
- TOXENV : " py37-freeze"
21
22
PYTEST_NO_COVERAGE : " 1"
22
- - TOXENV : " py37-xdist"
23
23
24
24
matrix :
25
25
fast_finish : true
Original file line number Diff line number Diff line change
1
+ Fix ``CallInfo.__repr__ `` for when the call is not finished yet.
Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ def __repr__(self):
223
223
if self .excinfo :
224
224
status = "exception: %s" % str (self .excinfo .value )
225
225
else :
226
- status = "result: %r" % (self .result ,)
226
+ result = getattr (self , "result" , "<NOTSET>" )
227
+ status = "result: %r" % (result ,)
227
228
return "<CallInfo when=%r %s>" % (self .when , status )
228
229
229
230
Original file line number Diff line number Diff line change @@ -491,13 +491,26 @@ def test_callinfo():
491
491
assert ci .when == "123"
492
492
assert ci .result == 0
493
493
assert "result" in repr (ci )
494
+ assert repr (ci ) == "<CallInfo when='123' result: 0>"
495
+
494
496
ci = runner .CallInfo (lambda : 0 / 0 , "123" )
495
497
assert ci .when == "123"
496
498
assert not hasattr (ci , "result" )
499
+ assert repr (ci ) == "<CallInfo when='123' exception: division by zero>"
497
500
assert ci .excinfo
498
501
assert "exc" in repr (ci )
499
502
500
503
504
+ def test_callinfo_repr_while_running ():
505
+ def repr_while_running ():
506
+ f = sys ._getframe ().f_back
507
+ assert "func" in f .f_locals
508
+ assert repr (f .f_locals ["self" ]) == "<CallInfo when='when' result: '<NOTSET>'>"
509
+
510
+ ci = runner .CallInfo (repr_while_running , "when" )
511
+ assert repr (ci ) == "<CallInfo when='when' result: None>"
512
+
513
+
501
514
# design question: do we want general hooks in python files?
502
515
# then something like the following functional tests makes sense
503
516
You can’t perform that action at this time.
0 commit comments