pytester: clarify _makefile signature (#6675)

This commit is contained in:
Daniel Hahler 2020-02-05 20:42:57 +01:00 committed by GitHub
parent 632800add5
commit cdc7e13067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -608,14 +608,14 @@ class Testdir:
"""
self.tmpdir.chdir()
def _makefile(self, ext, args, kwargs, encoding="utf-8"):
items = list(kwargs.items())
def _makefile(self, ext, lines, files, encoding="utf-8"):
items = list(files.items())
def to_text(s):
return s.decode(encoding) if isinstance(s, bytes) else str(s)
if args:
source = "\n".join(to_text(x) for x in args)
if lines:
source = "\n".join(to_text(x) for x in lines)
basename = self.request.function.__name__
items.insert(0, (basename, source))