Commit 56597e2d authored by Roman Yurchak's avatar Roman Yurchak

Use NamedTemporaryFile in pytest

parent 57617053
......@@ -6,6 +6,9 @@ source:
url: https://files.pythonhosted.org/packages/55/50/399419c03c39bf41faa7cbd5a8976c076037b2d76adf2535610919806d67/pytest-3.6.3.tar.gz
md5: 8ca6124a3a80f9555c50f5c09056ea02
patches:
- patches/use-named-temporary-file.patch
requirements:
run:
- atomicwrites
......
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py
index faa767a8..23298939 100644
--- a/src/_pytest/capture.py
+++ b/src/_pytest/capture.py
@@ -10,7 +10,7 @@ import sys
import os
import io
from io import UnsupportedOperation
-from tempfile import TemporaryFile
+from tempfile import NamedTemporaryFile as TemporaryFile
import six
import pytest
diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py
index 6af202d1..9b192918 100644
--- a/src/_pytest/pastebin.py
+++ b/src/_pytest/pastebin.py
@@ -29,7 +29,7 @@ def pytest_configure(config):
# when using pytest-xdist, for example
if tr is not None:
# pastebin file will be utf-8 encoded binary file
- config._pastebinfile = tempfile.TemporaryFile("w+b")
+ config._pastebinfile = tempfile.NamedTemporaryFile("w+b")
oldwrite = tr._tw.write
def tee_write(s, **kwargs):
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment