Skip to content

Commit

Permalink
Merge pull request #3893 from jirikuncar/3892-macos
Browse files Browse the repository at this point in the history
travis: run tests on macOS
  • Loading branch information
nicoddemus authored Aug 28, 2018
2 parents 2a059b1 + 32575f9 commit b77e533
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions changelog/3888.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix macOS specific code using ``capturemanager`` plugin in doctests.
3 changes: 2 additions & 1 deletion src/_pytest/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def _disable_output_capturing_for_darwin(self):
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)

Expand Down
1 change: 1 addition & 0 deletions testing/python/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@ def test_package_fixture_complex(self, testdir):
values = []
"""
)
testdir.syspathinsert(testdir.tmpdir.dirname)
package = testdir.mkdir("package")
package.join("__init__.py").write("")
package.join("conftest.py").write(
Expand Down

0 comments on commit b77e533

Please sign in to comment.