Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
* More explicit test step name for pytest related tests
* Added no-cover for typechecking code
* Fixup redundant creation of a dir for existing file
  • Loading branch information
elchupanebrej committed Feb 4, 2024
1 parent 272c536 commit f661732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Features/Tutorial launch.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Tutorial examples could be executed successfully

Scenario: Catalog example with simplest steps
Given Copy path from "docs/tutorial" to "tutorial"
Given Copy path from "docs/tutorial" to test path "tutorial"
When run pytest
|cli_args| --rootdir=tutorial| tutorial/tests |

Expand Down
7 changes: 3 additions & 4 deletions tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pytest_bdd.compatibility.pytest import assert_outcomes
from pytest_bdd.utils import compose

if TYPE_CHECKING:
if TYPE_CHECKING: # pragma: no cover
from pytest_bdd.compatibility.pytest import Testdir


Expand Down Expand Up @@ -56,12 +56,11 @@ def check_pytest_stdout_lines(pytest_result, step):
pytest_result.stdout.fnmatch_lines(lines)


@given(re.compile(r"Copy path from \"(?P<initial_path>(\w|\\|.)+)\" to \"(?P<final_path>(\w|\\|.)+)\""))
@given(re.compile(r"Copy path from \"(?P<initial_path>(\w|\\|.)+)\" to test path \"(?P<final_path>(\w|\\|.)+)\""))
def copy_path(request, testdir: "Testdir", initial_path, final_path, step):
full_initial_path = Path(request.config.rootdir) / Path(initial_path).as_posix()
full_initial_path = (Path(request.config.rootdir) / Path(initial_path).as_posix()).resolve(strict=True)
full_final_path = Path(testdir.tmpdir) / Path(final_path).as_posix()
if full_initial_path.is_file():
full_initial_path.parent.mkdir(parents=True, exist_ok=True)
full_final_path.parent.mkdir(parents=True, exist_ok=True)
shutil.copy(full_initial_path, full_final_path)

Check warning on line 65 in tests/e2e/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/e2e/conftest.py#L64-L65

Added lines #L64 - L65 were not covered by tests
else:
Expand Down

0 comments on commit f661732

Please sign in to comment.