Skip to content

Commit

Permalink
Merge branch 'junit5-features' of github.com:EngineeringSoftware/inli…
Browse files Browse the repository at this point in the history
…netest into junit5-features
  • Loading branch information
sweetStreet committed Jun 21, 2023
2 parents 1fd193c + bbe2867 commit 26d5b0b
Show file tree
Hide file tree
Showing 24 changed files with 880 additions and 332 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<img src="I-Test-logos.png" alt="Ekstazi" width="238" height="224">

I-Test is a framework for writing inline tests in Python and Java.

## Introduction

This repo contains the code and data for producing the experiments in
Expand Down Expand Up @@ -31,7 +32,7 @@ The data includes:
* **replicate our performance evaluation of I-Test**: see detailed steps in [REPLICATION.md](/REPLICATION.md)
* **replicate other parts of our paper, e.g., collecting examples and user study**: we already described the steps in the paper, and you may find the documents and intermediate files for those in this repository; see the remainder of this README for more details

## Content of this Repository
## Repo structure

- [java](/java): code of I-Test framework for Java
- [python](/python): code of I-Test framework for Python
Expand Down Expand Up @@ -127,7 +128,6 @@ the logs by doing `python -m research.exp_integrated view_result
(modify the results file path accordingly), and fix the
scripts/patches as needed.


## Citation

Title: [Inline Tests][paper-url]
Expand Down
8 changes: 6 additions & 2 deletions python/.gitignore
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__/
19 changes: 19 additions & 0 deletions python/LICENSE
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.
52 changes: 52 additions & 0 deletions python/README.rst
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.
8 changes: 8 additions & 0 deletions python/changelog
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
Loading

0 comments on commit 26d5b0b

Please sign in to comment.