summaryrefslogtreecommitdiff
path: root/testing/test_pastebin.py
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2019-05-27 20:31:52 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2019-06-02 14:39:11 -0300
commit4d49ba65297102110ae8aeecdb3b82b23a231fba (patch)
tree10a917331db131a6728775ff7d462732ff1f9466 /testing/test_pastebin.py
parent733f43b02eafe2934c2e86b7d0370e25dfe95a48 (diff)
downloadpytest-4d49ba65297102110ae8aeecdb3b82b23a231fba.tar.gz
Drop Python 2.7 and 3.4 support
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to #5275
Diffstat (limited to 'testing/test_pastebin.py')
-rw-r--r--testing/test_pastebin.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/testing/test_pastebin.py b/testing/test_pastebin.py
index 9491f6d90..0d17ad73f 100644
--- a/testing/test_pastebin.py
+++ b/testing/test_pastebin.py
@@ -3,8 +3,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
-import sys
-
import pytest
@@ -74,10 +72,7 @@ class TestPasteCapture(object):
"""
)
result = testdir.runpytest("--pastebin=all")
- if sys.version_info[0] == 3:
- expected_msg = "*assert '☺' == 1*"
- else:
- expected_msg = "*assert '\\xe2\\x98\\xba' == 1*"
+ expected_msg = "*assert '☺' == 1*"
result.stdout.fnmatch_lines(
[
expected_msg,
@@ -110,14 +105,9 @@ class TestPaste(object):
return DummyFile()
- if sys.version_info < (3, 0):
- import urllib
-
- monkeypatch.setattr(urllib, "urlopen", mocked)
- else:
- import urllib.request
+ import urllib.request
- monkeypatch.setattr(urllib.request, "urlopen", mocked)
+ monkeypatch.setattr(urllib.request, "urlopen", mocked)
return calls
def test_create_new_paste(self, pastebin, mocked_urlopen):
@@ -126,7 +116,7 @@ class TestPaste(object):
assert len(mocked_urlopen) == 1
url, data = mocked_urlopen[0]
assert type(data) is bytes
- lexer = "python3" if sys.version_info[0] == 3 else "python"
+ lexer = "python3"
assert url == "https://bpaste.net"
assert "lexer=%s" % lexer in data.decode()
assert "code=full-paste-contents" in data.decode()