Skip to content

Commit

Permalink
Merge pull request #65 from asfadmin/kfbx.topic.v3.0.0
Browse files Browse the repository at this point in the history
Removes py requirement per cve, upgrades pytest to 8.1.1
  • Loading branch information
SpicyGarlicAlbacoreRoll committed Apr 24, 2024
2 parents 4897a92 + 6e48639 commit 8c5981e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

------

## [v3.0.0](https://github.com/asfadmin/Discovery-PytestAutomation/compare/v2.0.1...v3.0.0)

### Breaking Change:
- Upgraded to pytest-8. **Plugin will now only work with pytest>=8.0.0**.

### Fixed:
- Completely removes legacy dependency from requirements.txt (`py` package) per cve advisory https://github.com/advisories/GHSA-w596-4wvx-j9j6

------

## [v2.0.1](https://github.com/asfadmin/Discovery-PytestAutomation/compare/v2.0.0...v2.0.1)

### Fixed:
Expand Down
1 change: 0 additions & 1 deletion automation/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from _pytest.config import Config

import os
import re
import fnmatch

# Returns true if any "section" (any part between /, "section1/section2/..."),
Expand Down
9 changes: 5 additions & 4 deletions automation/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# For type hints only:
from pytest import Session, File
from _pytest.config.argparsing import Parser
from py._path.local import LocalPath
from _pytest.nodes import Collector

# Runs once at the start of everything:
Expand Down Expand Up @@ -46,6 +45,8 @@ def pytest_addoption(parser: Parser) -> None:
help = "Skips ALL the tests. (Added for pipeline use).")

# Based on: https://docs.pytest.org/en/6.2.x/example/nonpython.html
def pytest_collect_file(parent: Collector, path: LocalPath) -> File:
if path.ext in [".yml", ".yaml"] and path.basename.startswith("test_"):
return yamlfile.YamlFile.from_parent(parent, path=pathlib.Path(path))
# path is deprecated, using file_path
# https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest_collect_file
def pytest_collect_file(parent: Collector, file_path: pathlib.Path) -> File:
if file_path.suffix in [".yml", ".yaml"] and file_path.name.startswith("test_"):
return yamlfile.YamlFile.from_parent(parent, path=file_path)
14 changes: 6 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
attrs==21.4.0
iniconfig==1.1.1
pluggy==1.0.0
py==1.11.0
pyparsing==3.0.9
pytest==7.1.2
PyYAML==6.0
toml==0.10.2
exceptiongroup==1.2.1
iniconfig==2.0.0
packaging==24.0
pluggy==1.5.0
pytest==8.1.1
PyYAML==6.0.1
tomli==2.0.1

0 comments on commit 8c5981e

Please sign in to comment.