From f8dd6349c13d47223f6c280f8c755cc0e1196d41 Mon Sep 17 00:00:00 2001 From: Michael Goerz Date: Fri, 30 Aug 2019 15:34:03 -0400 Subject: [PATCH] Fix "lexer" being used when uploading to bpaste.net Closes #5806. --- changelog/5806.bugfix.rst | 1 + src/_pytest/pastebin.py | 2 +- testing/test_pastebin.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog/5806.bugfix.rst diff --git a/changelog/5806.bugfix.rst b/changelog/5806.bugfix.rst new file mode 100644 index 000000000..ec887768d --- /dev/null +++ b/changelog/5806.bugfix.rst @@ -0,0 +1 @@ +Fix "lexer" being used when uploading to bpaste.net from ``--pastebin`` to "text". diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py index 38ff97f2d..77b4e2621 100644 --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -65,7 +65,7 @@ def create_new_paste(contents): from urllib.request import urlopen from urllib.parse import urlencode - params = {"code": contents, "lexer": "python3", "expiry": "1week"} + params = {"code": contents, "lexer": "text", "expiry": "1week"} url = "https://bpaste.net" try: response = ( diff --git a/testing/test_pastebin.py b/testing/test_pastebin.py index a1bc0622e..86a42f9e8 100644 --- a/testing/test_pastebin.py +++ b/testing/test_pastebin.py @@ -165,7 +165,7 @@ class TestPaste: assert len(mocked_urlopen) == 1 url, data = mocked_urlopen[0] assert type(data) is bytes - lexer = "python3" + lexer = "text" assert url == "https://bpaste.net" assert "lexer=%s" % lexer in data.decode() assert "code=full-paste-contents" in data.decode()