Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fcf2d07

Browse filesBrowse files
sobolevnhugovk
andauthored
gh-132316: Require socket and GITHUB_TOKEN env to use GitHubArtifactDatabase (#132348)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 6535703 commit fcf2d07
Copy full SHA for fcf2d07

File tree

Expand file treeCollapse file tree

1 file changed

+10
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-2
lines changed

‎Lib/test/support/hypothesis_helper.py

Copy file name to clipboardExpand all lines: Lib/test/support/hypothesis_helper.py
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
else:
88
# Regrtest changes to use a tempdir as the working directory, so we have
99
# to tell Hypothesis to use the original in order to persist the database.
10-
from .os_helper import SAVEDCWD
10+
from test.support import has_socket_support
11+
from test.support.os_helper import SAVEDCWD
1112
from hypothesis.configuration import set_hypothesis_home_dir
1213

1314
set_hypothesis_home_dir(os.path.join(SAVEDCWD, ".hypothesis"))
@@ -28,7 +29,14 @@
2829
# of failing examples, and also use a pull-through cache to automatically
2930
# replay any failing examples discovered in CI. For details on how this
3031
# works, see https://hypothesis.readthedocs.io/en/latest/database.html
31-
if "CI" not in os.environ:
32+
# We only do that if a GITHUB_TOKEN env var is provided, see:
33+
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
34+
# And Python is built with socket support:
35+
if (
36+
has_socket_support
37+
and "CI" not in os.environ
38+
and "GITHUB_TOKEN" in os.environ
39+
):
3240
from hypothesis.database import (
3341
GitHubArtifactDatabase,
3442
MultiplexedDatabase,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.