Skip to content

Commit b77e533

Browse files
authored
Merge pull request #3893 from jirikuncar/3892-macos
travis: run tests on macOS
2 parents 2a059b1 + 32575f9 commit b77e533

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ jobs:
4444
python: '3.7'
4545
sudo: required
4646
dist: xenial
47+
- &test-macos
48+
language: generic
49+
os: osx
50+
osx_image: xcode9.4
51+
sudo: required
52+
install:
53+
- python -m pip install --pre tox
54+
env: TOXENV=py27
55+
- <<: *test-macos
56+
env: TOXENV=py37
57+
before_install:
58+
- brew update
59+
- brew upgrade python
60+
- brew unlink python
61+
- brew link python
4762

4863
- stage: deploy
4964
python: '3.6'

changelog/3888.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix macOS specific code using ``capturemanager`` plugin in doctests.

src/_pytest/doctest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ def _disable_output_capturing_for_darwin(self):
203203
return
204204
capman = self.config.pluginmanager.getplugin("capturemanager")
205205
if capman:
206-
out, err = capman.suspend_global_capture(in_=True)
206+
capman.suspend_global_capture(in_=True)
207+
out, err = capman.read_global_capture()
207208
sys.stdout.write(out)
208209
sys.stderr.write(err)
209210

testing/python/fixture.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,7 @@ def test_package_fixture_complex(self, testdir):
15841584
values = []
15851585
"""
15861586
)
1587+
testdir.syspathinsert(testdir.tmpdir.dirname)
15871588
package = testdir.mkdir("package")
15881589
package.join("__init__.py").write("")
15891590
package.join("conftest.py").write(

0 commit comments

Comments
 (0)