File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -115,22 +115,24 @@ def run_checks(request):
115
115
from django .core .management import call_command
116
116
from django .core .management .base import SystemCheckError
117
117
118
+ config = request .config
119
+
118
120
# Only run once per process
119
- if getattr (run_checks , 'ran ' , False ):
121
+ if getattr (config , '_pytest_django_checks_ran ' , False ):
120
122
return
121
- run_checks . ran = True
123
+ config . _pytest_django_checks_ran = True
122
124
123
125
out = StringIO ()
124
126
try :
125
127
call_command ('check' , stdout = out , stderr = out )
126
- except SystemCheckError as ex :
127
- run_checks . exc = ex
128
+ except SystemCheckError as exc :
129
+ config . _pytest_django_checks_exc = exc
128
130
129
131
if hasattr (request .config , 'slaveinput' ):
130
132
# Kill the xdist test process horribly
131
133
# N.B. 'shouldstop' may be obeyed properly in the future as hinted at in
132
134
# https://github.com/pytest-dev/pytest-xdist/commit/e8fa73719662d1be5074a0750329fe0c35583484
133
- print (ex .args [0 ])
135
+ print (exc .args [0 ])
134
136
sys .exit (1 )
135
137
else :
136
138
# Ensure we get the EXIT_TESTSFAILED exit code
Original file line number Diff line number Diff line change @@ -331,7 +331,8 @@ def pytest_runtest_setup(item):
331
331
332
332
333
333
def pytest_terminal_summary (terminalreporter , exitstatus ):
334
- check_exc = getattr (run_checks , 'exc' , None )
334
+ config = terminalreporter .config
335
+ check_exc = getattr (config , '_pytest_django_checks_exc' , None )
335
336
if check_exc :
336
337
terminalreporter .write ('\n ' )
337
338
terminalreporter .write (str (check_exc ))
You can’t perform that action at this time.
0 commit comments