Update pytest (#1719)

This commit is contained in:
Hood Chatham 2021-07-19 04:50:35 +00:00 committed by GitHub
parent c0bec41b78
commit bf70c0925c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 79 deletions

View File

@ -0,0 +1,9 @@
package:
name: iniconfig
version: 1.1.1
source:
sha256: bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32
url: https://files.pythonhosted.org/packages/23/a2/97899f6bd0e873fed3a7e67ae8d3a08b21799430fb4da15cfedf10d6e2c2/iniconfig-1.1.1.tar.gz
test:
imports:
- iniconfig

View File

@ -1,24 +1,19 @@
package:
name: pytest
version: 3.6.3
version: 6.2.4
source:
url: https://files.pythonhosted.org/packages/55/50/399419c03c39bf41faa7cbd5a8976c076037b2d76adf2535610919806d67/pytest-3.6.3.tar.gz
md5: 8ca6124a3a80f9555c50f5c09056ea02
patches:
- patches/named-tmp-and-rm-dup2.patch
url: https://files.pythonhosted.org/packages/5b/98/92bbda5f83ed995ef8953349ef30c77c934abcc251c42ab3d7787a40c49c/pytest-6.2.4.tar.gz
sha256: 50bcad0a0b9c5a72c8e4e7c9855a3ad496ca6a881a3641b4260605450772c54b
requirements:
run:
- atomicwrites
- attrs
- more-itertools
- pluggy
- py
- setuptools
- six
- atomicwrites
- attrs
- more-itertools
- pluggy
- py
- setuptools
- six
- iniconfig
test:
imports:
- pytest
- pytest

View File

@ -1,61 +0,0 @@
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py
index faa767a8..518f5c8b 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
@@ -471,7 +471,6 @@ class FDCaptureBinary(object):
else:
self.syscapture = NoCapture()
self.tmpfile = tmpfile
- self.tmpfile_fd = tmpfile.fileno()
def __repr__(self):
return "<FDCapture %s oldfd=%s>" % (self.targetfd, self.targetfd_save)
@@ -482,7 +481,6 @@ class FDCaptureBinary(object):
os.fstat(self.targetfd_save)
except (AttributeError, OSError):
raise ValueError("saved filedescriptor not valid anymore")
- os.dup2(self.tmpfile_fd, self.targetfd)
self.syscapture.start()
def snap(self):
@@ -496,18 +494,14 @@ class FDCaptureBinary(object):
""" stop capturing, restore streams, return original capture file,
seeked to position zero. """
targetfd_save = self.__dict__.pop("targetfd_save")
- os.dup2(targetfd_save, self.targetfd)
- os.close(targetfd_save)
self.syscapture.done()
_attempt_to_close_capture_file(self.tmpfile)
def suspend(self):
self.syscapture.suspend()
- os.dup2(self.targetfd_save, self.targetfd)
def resume(self):
self.syscapture.resume()
- os.dup2(self.tmpfile_fd, self.targetfd)
def writeorg(self, data):
""" write to original file descriptor. """
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):

View File

@ -13,7 +13,7 @@ def test_pytest(selenium):
"""
)
selenium.run("pytest.main([base_dir / 'test_api.py'])")
selenium.run("pytest.main([str(base_dir / 'test_api.py')])")
logs = "\n".join(selenium.logs)
assert "INTERNALERROR" not in logs