Skip to content

Commit

Permalink
Fix collection on invalid test_run (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shutgun authored Oct 13, 2022
1 parent e833a30 commit 2962f83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [5.8.0] - 2022/10/13

### Added

* Allow attaching StringIO objects

### Fixed

* Tests are skipped, if an invalid test cycle is configured
* Tests are skipped, if the Jira credentials are wrong

## [5.7.3] - 2022/06/07

### Fixed
Expand Down
7 changes: 6 additions & 1 deletion pytest_adaptavist/_pytest_adaptavist.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,13 @@ def _setup_item_collection(
)
and test_case_keys
and f"{project_key}-{test_case_key}" not in test_case_keys
or (self.test_run_key and not test_run)
):
item.add_marker(pytest.mark.skip(reason="skipped as requested"))
item.add_marker(
pytest.mark.skip(
reason="Skipped as the test case is not in the given test cycle or could not login to Jira."
)
)
else:
collected_items.setdefault(f"{project_key}-{test_case_key}", []).append(item)
elif self.cfg.get_bool("skip_ntc_methods", False):
Expand Down

0 comments on commit 2962f83

Please sign in to comment.