-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'junit5-features' of github.com:EngineeringSoftware/inli…
…netest into junit5-features
- Loading branch information
Showing
24 changed files
with
880 additions
and
332 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -26,5 +26,9 @@ jobs: | |
run: | | ||
cd python | ||
pytest -p pytester --cov-report=term-missing | ||
- name: Test parallel execution | ||
run: | | ||
cd python/tests/parallelization | ||
bash time-parallel-tests.sh . | ||
- name: Publish Unit Test Results | ||
uses: EnricoMi/[email protected] |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/build | ||
/*.egg-info | ||
build/ | ||
/*.egg-info | ||
dist/ | ||
.tox/ | ||
.pytest_cache/ | ||
__pycache__/ |
This file contains 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,19 @@ | ||
Copyright (c) 2022 Inline Tests Dev Team | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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,52 @@ | ||
============= | ||
pytest-inline | ||
============= | ||
|
||
pytest-inline is a plugin for `pytest <http://pytest.org>`_ that writes inline tests. | ||
|
||
Installation and usage | ||
---------------------- | ||
|
||
Use ``pip install pytest-inline`` to install our Python pytest-plugin | ||
|
||
Use ``pytest .`` to run all inline tests in working directory | ||
|
||
Use ``pytest {filename}`` to run all inline tests in a Python file | ||
|
||
API | ||
--- | ||
Declaration an inline test | ||
|
||
- Here(test_name, parameterized, repeated, tag, disabled, timeout): | ||
1. test_name is a string that represents the name of the test. The default value is the file name + line number of the test statement. | ||
2. parameterized is a boolean value that indicates whether the test is parameterized. The default value is false. | ||
3. repeated is an integer that indicates how many times the test is repeated. The default value is 1. | ||
4. tag is a string that represents the tag of the test. The default value is an empty string. | ||
5. disabled is a boolean value that indicates whether the test is disabled. The default value is false. | ||
6. timeout is an integer that represents the timeout of the test. The default value is -1. | ||
|
||
|
||
Provide test inputs | ||
|
||
- given(variable, value): | ||
assign the value to the variable. | ||
|
||
|
||
Specify test oracles | ||
|
||
- check\_eq(actual\_value, expected\_value): | ||
check if the actual value is equal to the expected value. | ||
- check\_neq(actual\_value, expected\_value): | ||
check if the actual value is not equal to the expected value. | ||
- check\_true(expr): | ||
check if the boolean expression is true. | ||
- check\_false(expr): | ||
check if the boolean expression is false. | ||
- check\_none(variable): | ||
check if the variable is none. | ||
- check\_not\_none(variable): | ||
check if the variable is not none. | ||
- check\_same(actual\_value, expected\_value): | ||
check if the actual value and the expected value refer to the same object. | ||
- check\_not\_same(actual\_value, expected\_value): | ||
check if the actual value and the expected value refer to different objects. |
This file contains 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,8 @@ | ||
# Changelog | ||
|
||
## [1.0.0] | ||
### Added | ||
|
||
- JUnit 5 features: timeout, more types of assertions, assumptions, and running tests in order | ||
- Option "inlinetest-only" | ||
- Integration tests of running tests in parallel with pytest-xdist |
Oops, something went wrong.