Merge pull request #3893 from jirikuncar/3892-macos

travis: run tests on macOS
This commit is contained in:
Bruno Oliveira 2018-08-28 17:06:17 -03:00 committed by GitHub
commit b77e533693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -44,6 +44,21 @@ jobs:
python: '3.7'
sudo: required
dist: xenial
- &test-macos
language: generic
os: osx
osx_image: xcode9.4
sudo: required
install:
- python -m pip install --pre tox
env: TOXENV=py27
- <<: *test-macos
env: TOXENV=py37
before_install:
- brew update
- brew upgrade python
- brew unlink python
- brew link python
- stage: deploy
python: '3.6'

View File

@ -0,0 +1 @@
Fix macOS specific code using ``capturemanager`` plugin in doctests.

View File

@ -203,7 +203,8 @@ class DoctestItem(pytest.Item):
return
capman = self.config.pluginmanager.getplugin("capturemanager")
if capman:
out, err = capman.suspend_global_capture(in_=True)
capman.suspend_global_capture(in_=True)
out, err = capman.read_global_capture()
sys.stdout.write(out)
sys.stderr.write(err)

View File

@ -1584,6 +1584,7 @@ class TestFixtureManagerParseFactories(object):
values = []
"""
)
testdir.syspathinsert(testdir.tmpdir.dirname)
package = testdir.mkdir("package")
package.join("__init__.py").write("")
package.join("conftest.py").write(