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
1 change: 0 additions & 1 deletion .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ jobs:
uses: ./
with:
working-directory: '.'

4 changes: 2 additions & 2 deletions features/keep-license-in-project.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Feature: Keep license in project

A lot of people in the world do a lot of hard work to create software
Lots of people in the world do a lot of hard work to create software
to use freely. They only ask to keep the license with their code.
When fetching only a part of a repository with the 'src:' tag, the risk
If fetching only a part of a repository with the 'src:' tag, the risk
is you forget the license file.

Scenario: License is preserved in git repo sparse checkout and cannot be ignored
Expand Down
13 changes: 7 additions & 6 deletions features/steps/generic_steps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Steps for features tests."""

# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false
# pylint: disable=function-redefined, missing-function-docstring
# pylint: disable=function-redefined, missing-function-docstring, not-callable
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false

import difflib
import json
Expand All @@ -12,6 +12,7 @@
from typing import Iterable, List, Optional, Pattern, Tuple

from behave import given, then, when # pylint: disable=no-name-in-module
from behave.runner import Context

from dfetch.__main__ import DfetchFatalException, run
from dfetch.util.util import in_directory
Expand All @@ -29,8 +30,8 @@ def remote_server_path(context):
return "/".join(context.remotes_dir_path.split(os.sep))


def call_command(context, args: list[str], path: Optional[str] = ".") -> None:
context.log_capture.buffer = []
def call_command(context: Context, args: list[str], path: Optional[str] = ".") -> None:
length_at_start = len(context.captured.output)
with in_directory(path or "."):
try:
run(args)
Expand All @@ -39,7 +40,7 @@ def call_command(context, args: list[str], path: Optional[str] = ".") -> None:
context.cmd_returncode = 1
# Remove the color code + title
context.cmd_output = dfetch_title.sub(
"", ansi_escape.sub("", context.log_capture.getvalue())
"", ansi_escape.sub("", context.captured.output[length_at_start:].strip("\n"))
)


Expand Down Expand Up @@ -268,7 +269,7 @@ def step_impl(context):
assert os.listdir(project["path"]), f"{project} is just an empty directory!"


@then("'{path}' looks like")
@then("'{path}' looks like:")
def step_impl(context, path):
expected_dir = context.text.strip()
actual_dir = list_dir(path).strip()
Expand Down
6 changes: 3 additions & 3 deletions features/steps/git_steps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Steps for features tests."""

# pylint: disable=function-redefined, missing-function-docstring, import-error
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false
# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false

import os
import pathlib
Expand Down Expand Up @@ -62,7 +62,7 @@ def step_impl(context, tagname, name):
tag(tagname)


@given('a git-repository "{name}" with the manifest')
@given('a git-repository "{name}" with the manifest:')
@given('a git repository "{name}"')
def step_impl(context, name):
remote_path = os.path.join(context.remotes_dir, name)
Expand Down
6 changes: 3 additions & 3 deletions features/steps/manifest_steps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Steps for features tests."""

# pylint: disable=function-redefined, missing-function-docstring, import-error
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false
# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false

import os
import pathlib
Expand Down Expand Up @@ -40,7 +40,7 @@ def step_impl(context, name):
check_file(name, context.text)


@given("the manifest '{name}' with the projects")
@given("the manifest '{name}' with the projects:")
def step_impl(context, name):
projects = "\n".join(f" - name: {row['name']}" for row in context.table)
manifest = f"""manifest:
Expand Down
4 changes: 2 additions & 2 deletions features/steps/svn_steps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Steps for features tests."""

# pylint: disable=function-redefined, missing-function-docstring, import-error
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false
# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable
# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false

import os
import pathlib
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ docs = [
'sphinxcontrib-details-directive==0.1.0',
'sphinx-sitemap==2.7.2',
]
test = ['pytest==8.4.1', 'pytest-cov==6.2.1', 'behave==1.2.6']
test = ['pytest==8.4.1', 'pytest-cov==6.2.1', 'behave==1.3.0']
casts = ['asciinema==2.4.0']


Expand Down
Loading