diff --git a/.travis.yml b/.travis.yml index 728048cce..3136dec1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 007423a9e..0db3593d8 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -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): diff --git a/tox.ini b/tox.ini index a04f91ae5..0b1be0d33 100644 --- a/tox.ini +++ b/tox.ini @@ -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