Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitlab/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def main() -> None:
# This first parsing step is used to find the gitlab config to use, and
# load the propermodule (v3 or v4) accordingly. At that point we don't have
# any subparser setup
(options, _) = parser.parse_known_args(sys.argv)
options, _ = parser.parse_known_args(sys.argv)
try:
config = gitlab.config.GitlabConfigParser(options.gitlab, options.config_file)
except gitlab.config.ConfigError as e:
Expand Down
2 changes: 1 addition & 1 deletion requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r requirements.txt
argcomplete==2.0.0
black==25.12.0
black==26.1.0
commitizen==4.11.6
flake8==7.3.0
isort==7.0.0
Expand Down
6 changes: 2 additions & 4 deletions tests/functional/cli/test_cli_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

import pytest

content = textwrap.dedent(
"""\
content = textwrap.dedent("""\
test-artifact:
script: echo "test" > artifact.txt
artifacts:
untracked: true
"""
)
""")
data = {
"file_path": ".gitlab-ci.yml",
"branch": "main",
Expand Down
22 changes: 6 additions & 16 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,28 +268,22 @@ def test_ssl_verify_as_str(m_open, monkeypatch):
def test_data_from_helper(m_open, monkeypatch, tmp_path):
helper = tmp_path / "helper.sh"
helper.write_text(
dedent(
"""\
dedent("""\
#!/bin/sh
echo "secret"
"""
),
"""),
encoding="utf-8",
)
helper.chmod(0o755)

fd = io.StringIO(
dedent(
f"""\
fd = io.StringIO(dedent(f"""\
[global]
default = helper

[helper]
url = https://helper.url
oauth_token = helper: {helper}
"""
)
)
"""))

fd.close = mock.Mock(return_value=None)
m_open.return_value = fd
Expand All @@ -306,18 +300,14 @@ def test_data_from_helper(m_open, monkeypatch, tmp_path):
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
def test_from_helper_subprocess_error_raises_error(m_open, monkeypatch):
# using false here to force a non-zero return code
fd = io.StringIO(
dedent(
"""\
fd = io.StringIO(dedent("""\
[global]
default = helper

[helper]
url = https://helper.url
oauth_token = helper: false
"""
)
)
"""))

fd.close = mock.Mock(return_value=None)
m_open.return_value = fd
Expand Down