← 返回首页
chore: Only check for our UserWarning · python-gitlab/python-gitlab@bd4dfb4 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit bd4dfb4

Browse files
chore: Only check for our UserWarning
The GitHub CI is showing a ResourceWarning, causing our test to fail. Update test to only look for our UserWarning which should not appear. What was seen when debugging the GitHub CI: {message: ResourceWarning( "unclosed <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 50862), raddr=('127.0.0.1', 8080)>" ), category: 'ResourceWarning', filename: '/home/runner/work/python-gitlab/python-gitlab/.tox/api_func_v4/lib/python3.10/site-packages/urllib3/poolmanager.py', lineno: 271, line: None }
1 parent 98f1956 commit bd4dfb4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎tests/functional/api/test_gitlab.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ def test_list_all_false_nowarning(gl, recwarn):
240240
def test_list_all_true_nowarning(gl, get_all_kwargs, recwarn):
241241
"""Using `get_all=True` will disable the warning"""
242242
items = gl.gitlabciymls.list(**get_all_kwargs)
243-
assert not recwarn
243+
for warn in recwarn:
244+
if issubclass(warn.category, UserWarning):
245+
# Our warning has a link to the docs in it, make sure we don't have
246+
# that.
247+
assert "python-gitlab.readthedocs.io" not in str(warn.message)
244248
assert len(items) > 20
245249

246250

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.