Skip to content

Commit

Permalink
Ensure we never try to talk to the network on CI
Browse files Browse the repository at this point in the history
Set the record mode to "never" for betamax on both Appveyor and Travis.
Also, allow our archive test to fail on Appveyor because we seem to
constantly run into issues with just that test.
  • Loading branch information
sigmavirus24 committed Dec 26, 2017
1 parent d94a00a commit 0332689
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ notifications:

env:
global:
- TRAVIS_GH3="True"
- GH_RECORD_MODE='none'

matrix:
include:
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
@@ -1,6 +1,7 @@
version: build-{build}-{branch}

environment:
GH_RECORD_MODE: "none"
matrix:
# http://www.appveyor.com/docs/installed-software#python lists available
# versions
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Expand Up @@ -13,7 +13,7 @@
with betamax.Betamax.configure() as config:
config.cassette_library_dir = 'tests/cassettes'

record_mode = 'never' if os.environ.get('TRAVIS_GH3') else 'once'
record_mode = os.environ.get('GH_RECORD_MODE', 'once')

config.default_cassette_options['record_mode'] = record_mode

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_repos_release.py
Expand Up @@ -2,11 +2,15 @@
import os
import tempfile

import pytest

from .helper import IntegrationHelper


class TestRelease(IntegrationHelper):
"""Release class integration tests."""

@pytest.mark.xfail('os.environ.get("APPVEYOR") == "True"')
def test_archive(self):
"""Test the ability to download a release archive."""
cassette_name = self.cassette_name('archive')
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -3,7 +3,7 @@ envlist = py{27,34,35,py},py{27,34}-flake8,docstrings
minversion = 2.5.0

[testenv]
passenv = GH_*
passenv = GH_* APPVEYOR*
pip_pre = False
deps =
requests{env:REQUESTS_VERSION:>=2.0}
Expand Down

0 comments on commit 0332689

Please sign in to comment.