-
Notifications
You must be signed in to change notification settings - Fork 98
pytest evaluation #2717
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
Open
alekseyborisyukvalidas
wants to merge
6
commits into
eclipse-score:main
Choose a base branch
from
alekseyborisyukvalidas:albor_pytest_evaluation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
pytest evaluation #2717
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5cff4ac
Added pytest evaluation
alekseyborisyukvalidas 1de5537
Updated diagram
alekseyborisyukvalidas 1286268
Updated diagram, updated version in tool list
alekseyborisyukvalidas 8856bd1
Merge branch 'albor_pytest_evaluation' of github.com:alekseyborisyukv…
alekseyborisyukvalidas fcb76b7
Merge branch 'eclipse-score:main' into albor_pytest_evaluation
alekseyborisyukvalidas d23f94f
Merge branch 'albor_pytest_evaluation' of github.com:alekseyborisyukv…
alekseyborisyukvalidas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
208 changes: 208 additions & 0 deletions
208
docs/score_tools/tools_testing_frameworks/_assets/pytest.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,4 @@ Testing Frameworks Tools Overview | |
|
|
||
| gtest | ||
| itf | ||
| pytest | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| .. | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| .. doc_tool:: pytest | ||
| :id: doc_tool__pytest | ||
| :status: draft | ||
| :version: 9.0.1 | ||
| :tcl: LOW | ||
| :safety_affected: YES | ||
| :security_affected: YES | ||
| :realizes: wp__tool_verification_report | ||
| :tags: tool_management, tools_testing_frameworks | ||
|
|
||
| Pytest Verification Report | ||
| ========================== | ||
|
|
||
| Introduction | ||
| ------------ | ||
| Scope and purpose | ||
| ~~~~~~~~~~~~~~~~~ | ||
| Pytest is a Python testing framework that supports unit, integration and system | ||
| testing. It provides fixtures, plugins, and multiple reporting formats to help | ||
| developers write readable and maintainable tests for Python projects. | ||
|
|
||
| Inputs and outputs | ||
| ~~~~~~~~~~~~~~~~~~ | ||
| | Inputs: Pytest-based test files (Python), Configuration files | ||
| | Outputs: Test report (console output, XML/HTML reports), logs | ||
|
|
||
| .. figure:: _assets/pytest.drawio.svg | ||
| :width: 100% | ||
| :align: center | ||
| :alt: Pytest overview | ||
|
|
||
| Pytest overview | ||
|
|
||
| Available information | ||
| ~~~~~~~~~~~~~~~~~~~~~ | ||
| - Project: pytest | ||
| - Official repository: https://github.com/pytest-dev/pytest | ||
| - Official documentation: https://docs.pytest.org | ||
| - Plugin ecosystem: https://docs.pytest.org/en/stable/reference.html#plugins | ||
| - Example usage in S-CORE: inspect `pyproject.toml` / `pytest.ini` in project modules | ||
|
|
||
| Installation and integration | ||
| ---------------------------- | ||
| Installation | ||
| ~~~~~~~~~~~~ | ||
| | To add the Pytest Bazel dependency to your project or module, include the following line in your MODULE.bazel file: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| bazel_dep(name = "score_python_basics", version = "x.y.z") | ||
|
|
||
| Integration | ||
| ~~~~~~~~~~~ | ||
| Pytest integrates with Python projects via `pytest.ini`, `pyproject.toml`, or | ||
| `tox.ini` or via part of any other tools (e.g. ITF). | ||
|
|
||
| Environment | ||
| ~~~~~~~~~~~ | ||
| Requires a supported Python interpreter and any test-time dependencies (mocking, | ||
| test-data fixtures). CI runners must preserve environment variables and paths | ||
| needed by tests. | ||
|
|
||
| Safety evaluation | ||
| ----------------- | ||
| This section outlines the safety evaluation of Pytest for its use within the | ||
| S-CORE project. | ||
|
|
||
|
|
||
| .. list-table:: Safety evaluation | ||
| :header-rows: 1 | ||
| :widths: 1 2 8 2 6 4 2 2 | ||
|
|
||
| * - Malfunction identification | ||
| - Use case description | ||
| - Malfunctions | ||
| - Impact on safety? | ||
| - Impact safety measures available? | ||
| - Impact safety detection sufficient? | ||
| - Further additional safety measure required? | ||
| - Confidence (automatic calculation) | ||
| * - 1 | ||
| - Run tests and generate test report | ||
| - | Fails to load input files | ||
| | | ||
| | Pytest fails to load provided file even if file is present and accessible. | ||
| - yes | ||
| - (implicit) Check test run status | ||
| - yes | ||
| - no | ||
| - high | ||
| * - 2 | ||
| - Run tests and generate test report | ||
| - | Fails to write result to file | ||
| | | ||
| | Pytest was not able to save results in file(s). | ||
| - yes | ||
| - (implicit) Check test run status | ||
| - yes | ||
| - no | ||
| - high | ||
| * - 3 | ||
| - Run tests and generate test report | ||
| - | Fails to collect results of the test(s) | ||
| | | ||
| | Pytest was not able to collect results of executed test and generate test report. | ||
| - no | ||
| - no | ||
| - yes | ||
| - no | ||
| - high | ||
| * - 4 | ||
| - Run tests and generate test report | ||
| - | Fails to detect an existing error | ||
| | | ||
| | Pytest fails to detect the presence of existing errors. | ||
| - yes | ||
| - no | ||
| - no | ||
| - yes (qualification) | ||
| - low | ||
| * - 5 | ||
| - Run tests and generate test report | ||
| - | Indicates presence of a non-existing error | ||
| | | ||
| | Pytest indicates the presence of errors that do not exist. | ||
| - no | ||
| - no | ||
| - yes | ||
| - no | ||
| - high | ||
| * - 6 | ||
| - Run tests and generate test report | ||
| - | Fails to execute the test | ||
| | | ||
| | Pytest fails to execute specific test from the test plan | ||
| - yes | ||
| - | - (implicit) Check test run status | ||
| | - Review test report for completeness (all expected tests are executed) | ||
| - yes | ||
| - no | ||
| - high | ||
| * - 7 | ||
| - Run tests and generate test report | ||
| - | Produces wrong test report | ||
| | | ||
| | Pytest fails to save correct test result in test report. | ||
| - yes | ||
| - Review test report for correctness (format is correct) and completeness (all expected tests are executed) | ||
| - yes | ||
| - no | ||
| - high | ||
|
|
||
| Security evaluation | ||
| ------------------- | ||
| This section outlines the security evaluation of Pytest for use within the | ||
| S-CORE project. | ||
|
|
||
|
|
||
| .. list-table:: Security evaluation | ||
| :header-rows: 1 | ||
|
|
||
| * - Threat identification | ||
| - Use case description | ||
| - Threats | ||
| - Impact on security? | ||
| - Impact security measures available? | ||
| - Impact security detection sufficient? | ||
| * - 1 | ||
| - TBD | ||
| - TBD | ||
| - TBD | ||
| - TBD | ||
| - TBD | ||
|
|
||
| Result | ||
| ~~~~~~ | ||
| Pytest requires qualification for use in safety-related software development | ||
| according to ISO 26262. | ||
|
|
||
|
|
||
| **Tool Qualification** | ||
| ---------------------- | ||
| Based on method: validation of the software tool. | ||
|
|
||
| Requirements and testing aspects | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| Pytest is an open-source framework and does not provide formal, vendor-defined | ||
| requirements. Project teams must derive requirements for the specific pytest | ||
| features and plugins used and validate pytest against these requirements. | ||
|
|
||
| .. [1] The tool version mentioned in this document is preliminary. | ||
| It is subject to change and will be updated in future. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this say "yes" to there is an impact on detection or there is a detection? Where can I find the detection? Is "Check test run status" the entire detection description? Unfortunately, I have no idea what that means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "yes" is to "Impact safety detection sufficient?"