8000 Merge pull request #652 from sigmavirus24/fix-integration-tests · pythonthings/github3.py@0c69d9c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c69d9c

Browse files
Merge pull request sigmavirus24#652 from sigmavirus24/fix-integration-tests
XFail some integration tests
2 parents bc3245e + bcb3763 commit 0c69d9c
< 10000 /header>

File tree

7 files changed

+25
-0
lines changed

7 files changed

+25
-0
lines changed

github3/api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ def enterprise_login(username=None, password=None, token=None, url=None,
100100

101101
def emojis():
102102
return gh.emojis()
103+
104+
103105
emojis.__doc__ = gh.emojis.__doc__
104106

105107

@@ -401,6 +403,8 @@ def octocat(say=None):
401403

402404
def organization(name):
403405
return gh.organization(name)
406+
407+
404408
organization.__doc__ = gh.organization.__doc__
405409

406410

@@ -418,11 +422,15 @@ def pull_request(owner, repository, number):
418422

419423
def rate_limit():
420424
return gh.rate_limit()
425+
426+
421427
rate_limit.__doc__ = gh.rate_limit.__doc__
422428

423429

424430
def repository(owner, repository):
425431
return gh.repository(owner, repository)
432+
433+
426434
repository.__doc__ = gh.repository.__doc__
427435

428436

@@ -636,6 +644,8 @@ def search_users(query, sort=None, order=None, per_page=None,
636644

637645
def user(username):
638646
return gh.user(username)
647+
648+
639649
user.__doc__ = gh.user.__doc__
640650

641651

github3/decorators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def generate_fake_error_response(msg, status_code=401, encoding='utf-8'):
9494
r._content = r.raw.read()
9595
return r
9696

97+
9798
# Use mock decorators when generating documentation, so all functino signatures
9899
# are displayed correctly
99100
if os.getenv('GENERATING_DOCUMENTATION', None) == 'github3':

tests/integration/test_orgs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""Integration tests for methods implemented on Organization."""
33
import pytest
4+
import requests
45

56
import github3
67

@@ -93,6 +94,8 @@ def test_edit(self):
9394

9495
assert o.edit(location='Madison, WI') is True
9596

97+
@pytest.mark.xfail(requests.__build__ >= 0x021100,
98+
reason="Requests 2.11.0 breaks our cassettes.")
9699
def test_is_member(self):
97100
"""Test the ability to check if a User is a member of the org."""
98101
cassette_name = self.cassette_name('is_member')

tests/integration/test_repos_release.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
import os
33
import tempfile
44

5+
import pytest
6+
import requests
7+
58
from .helper import IntegrationHelper
69

710

811
class TestRelease(IntegrationHelper):
12+
13+
@pytest.mark.xfail(requests.__build__ >= 0x021100,
14+
reason="Requests 2.11.0 breaks our cassettes")
915
def test_archive(self):
1016
"""Test the ability to download a release archive."""
1117
cassette_name = self.cassette_name('archive')

tests/integration/test_repos_repo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import github3.exceptions as exc
44

55
import pytest
6+
import requests
67

78
from . import helper
89

@@ -472,6 +473,8 @@ def test_deployments(self):
472473
for d in repository.deployments():
473474
assert isinstance(d, github3.repos.deployment.Deployment)
474475

476+
@pytest.mark.xfail(requests.__build__ >= 0x021100,
477+
reason="Requests breaks our recorded cassettes")
475478
def test_directory_contents(self):
476479
"""Test that a directory's contents can be retrieved."""
477480
cassette_name = self.cassette_name('directory_contents')

tests/unit/test_github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def url_for(path=''):
1010
"""Simple function to generate URLs with the base GitHub URL."""
1111
return 'https://api.github.com/' + path.strip('/')
1212

13+
1314
enterprise_url_for = helper.create_url_helper('https://enterprise.github3.com')
1415

1516

tests/unit/test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def test_boolean_raises_exception(self):
7575
"""Verify boolean tests for response codes correctly."""
7676
response = requests.Response()
7777
response.status_code = 512
78+
response.raw = io.BytesIO()
7879
with pytest.raises(exceptions.GitHubError):
7980
self.instance._boolean(response=response,
8081
true_code=200,

0 commit comments

Comments
 (0)
0