Merge pull request #5336 from blueyed/fix-pexpect

Fix pexpect tests on MacOS
This commit is contained in:
Daniel Hahler 2019-05-30 06:31:11 +02:00 committed by GitHub
commit 72fc43952b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -20,9 +20,6 @@ jobs:
include:
# OSX tests - first (in test stage), since they are the slower ones.
- &test-macos
# NOTE: (tests with) pexpect appear to be buggy on Travis,
# at least with coverage.
# Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
os: osx
osx_image: xcode10.1
language: generic
@ -33,7 +30,7 @@ jobs:
- python -V
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
- <<: *test-macos
env: TOXENV=py37-xdist
env: TOXENV=py37-pexpect,py37-xdist PYTEST_COVERAGE=1
before_install:
- which python3
- python3 -V

View File

@ -4,7 +4,6 @@ from __future__ import division
from __future__ import print_function
import os
import platform
import sys
import six
@ -153,10 +152,11 @@ class TestPDB(object):
@staticmethod
def flush(child):
if platform.system() == "Darwin":
return
if child.isalive():
# Read if the test has not (e.g. test_pdb_unittest_skip).
child.read()
child.wait()
assert not child.isalive()
def test_pdb_unittest_postmortem(self, testdir):
p1 = testdir.makepyfile(
@ -797,7 +797,6 @@ class TestPDB(object):
rest = child.read().decode("utf8")
assert "leave_pdb_hook" in rest
assert "1 failed" in rest
child.sendeof()
self.flush(child)
def test_pdb_custom_cls(self, testdir, custom_pdb_calls):

View File

@ -40,7 +40,7 @@ setenv =
lsof: _PYTEST_TOX_POSARGS_LSOF=--lsof
pexpect: _PYTEST_TOX_PLATFORM=linux|darwin
pexpect: _PYTEST_TOX_POSARGS_PEXPECT=testing/test_pdb.py testing/test_terminal.py testing/test_unittest.py
pexpect: _PYTEST_TOX_POSARGS_PEXPECT=-m uses_pexpect
twisted: _PYTEST_TOX_POSARGS_TWISTED=testing/test_unittest.py