Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes py requirement per cve, upgrades pytest to 8.1.1 #65

Merged
merged 1 commit into from
Apr 24, 2024
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
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