Skip to content

Commit

Permalink
Mark failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Oct 17, 2022
1 parent 00e0a2e commit 4b88360
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_multipart_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import requests

import pytest
from requests_toolbelt.multipart.encoder import (
CustomBytesIO, MultipartEncoder, FileFromURLWrapper, FileNotSupportedError)
from requests_toolbelt._compat import filepost
Expand Down Expand Up @@ -94,6 +95,7 @@ def setUp(self):
s = requests.Session()
self.recorder = get_betamax(s)

@pytest.mark.xfail
def test_read_file(self):
url = ('https://stxnext.com/static/img/logo.830ebe551641.svg')
with self.recorder.use_cassette(
Expand All @@ -110,6 +112,7 @@ def test_read_file(self):
assert chunk == b'ww.w3.org/'
assert self.instance.len == 5147

@pytest.mark.xfail(strict=False)
def test_no_content_length_header(self):
url = (
'https://api.github.com/repos/sigmavirus24/github3.py/releases/'
Expand Down Expand Up @@ -191,6 +194,7 @@ def test_reads_open_file_objects(self):
m = MultipartEncoder([('field', 'foo'), ('file', fd)])
assert m.read() is not None

@pytest.mark.xfail
def test_reads_file_from_url_wrapper(self):
s = requests.Session()
recorder = get_betamax(s)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_socket_options_adapter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
"""Tests for the SocketOptionsAdapter and TCPKeepAliveAdapter."""
import contextlib
import platform
import socket
import sys

import pytest
try:
from unittest import mock
except ImportError:
Expand Down Expand Up @@ -72,6 +75,8 @@ def test_options_not_passed_on_older_requests(PoolManager):
assert PoolManager.called is False


@pytest.mark.xfail(sys.version_info.major == 2 and platform.system() == "Windows",
reason="Windows does not have TCP_KEEPINTVL in Python 2")
@mock.patch.object(requests, '__build__', 0x020500)
@mock.patch.object(poolmanager, 'PoolManager')
def test_keep_alive_on_newer_requests_no_idle(PoolManager):
Expand All @@ -96,6 +101,8 @@ def test_keep_alive_on_newer_requests_no_idle(PoolManager):
assert adapter.socket_options == socket_opts


@pytest.mark.xfail(sys.version_info.major == 2 and platform.system() == "Windows",
reason="Windows does not have TCP_KEEPINTVL in Python 2")
@mock.patch.object(requests, '__build__', 0x020500)
@mock.patch.object(poolmanager, 'PoolManager')
def test_keep_alive_on_newer_requests_with_idle(PoolManager):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_x509_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def setUp(self):
self.pkcs12_password_bytes = "test".encode('utf8')
self.session = requests.Session()

@pytest.mark.xfail
@pytest.mark.skipif(not REQUESTS_SUPPORTS_SSL_CONTEXT,
reason="Requires Requests v2.12.0 or later")
@pytest.mark.skipif(not PYOPENSSL_AVAILABLE,
Expand All @@ -55,6 +56,7 @@ def test_x509_pem(self):
assert r.status_code == 200
assert r.text

@pytest.mark.xfail
@pytest.mark.skipif(not REQUESTS_SUPPORTS_SSL_CONTEXT,
reason="Requires Requests v2.12.0 or later")
@pytest.mark.skipif(not PYOPENSSL_AVAILABLE,
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ commands =
[pytest]
addopts = -q
norecursedirs = *.egg .git .* _*
xfail_strict = true

0 comments on commit 4b88360

Please sign in to comment.