Remove last references to obsolete py.code

Also remove some unnecessary references to py.builtin

Fix #305
This commit is contained in:
Bruno Oliveira
2018-07-23 17:33:59 -03:00
parent 55dc257f1c
commit fe1f239612
7 changed files with 25 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
import py
from __future__ import print_function
from difflib import unified_diff
@@ -17,10 +17,10 @@ def report_collection_diff(from_collection, to_collection, from_id, to_id):
fromfile=from_id,
tofile=to_id,
)
error_message = py.builtin._totext(
'Different tests were collected between {from_id} and {to_id}. '
'The difference is:\n'
'{diff}'
error_message = (
u'Different tests were collected between {from_id} and {to_id}. '
u'The difference is:\n'
u'{diff}'
).format(from_id=from_id, to_id=to_id, diff='\n'.join(diff))
msg = "\n".join([x.rstrip() for x in error_message.split("\n")])
return msg