Skip to content

Commit e84ba80

Browse files
authored
Update pastebin URL from bpaste to bpa.st (#9131)
1 parent e077f1c commit e84ba80

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

changelog/9131.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the URL used by ``--pastebin`` to use `bpa.st <http://bpa.st>`__.

src/_pytest/pastebin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_new_paste(contents: Union[str, bytes]) -> str:
7777
from urllib.parse import urlencode
7878

7979
params = {"code": contents, "lexer": "text", "expiry": "1week"}
80-
url = "https://bpaste.net"
80+
url = "https://bpa.st"
8181
try:
8282
response: str = (
8383
urlopen(url, data=urlencode(params).encode("ascii")).read().decode("utf-8")

testing/test_pastebin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ def test_pastebin_http_error(self, pastebin, mocked_urlopen_fail) -> None:
161161

162162
def test_create_new_paste(self, pastebin, mocked_urlopen) -> None:
163163
result = pastebin.create_new_paste(b"full-paste-contents")
164-
assert result == "https://bpaste.net/show/3c0c6750bd"
164+
assert result == "https://bpa.st/show/3c0c6750bd"
165165
assert len(mocked_urlopen) == 1
166166
url, data = mocked_urlopen[0]
167167
assert type(data) is bytes
168168
lexer = "text"
169-
assert url == "https://bpaste.net"
169+
assert url == "https://bpa.st"
170170
assert "lexer=%s" % lexer in data.decode()
171171
assert "code=full-paste-contents" in data.decode()
172172
assert "expiry=1week" in data.decode()

0 commit comments

Comments
 (0)