Skip to content

Commit

Permalink
Clean up PyTest README
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior committed May 16, 2024
1 parent 0176727 commit 469e358
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions PyTest/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# PyTest: Unit Tests for JSON-Schema-Analysis

This directory and its subdirectories contain everything needed for running the defined unit tests for ___JSON_Schema_Analysis___.
It uses *pytest* framework in version 4.3.0.

## Preliminaries

Before running the test you'll have to install *pytest* from PyPI by running the following instruction either in bash on Linux or in PowerShell on Windows.

```PowerShell
> pip install pytest
```
This directory and its subdirectories contain everything needed for running the defined unit tests for __JSON_Schema_Analysis__.

## Running the tests

To run the test, navigate to your local version of the PyTest directory on your prefered CLI. Run the following command.
To run the test, navigate to your local version of the PyTest directory on your preferred CLI. Run the following command.

```PowerShell
> pytest
```
pipenv run pytest

Pytest will automatically detect all files starting with test_ and include them in testing. In this case the only appropriate file is
test_schemagraph.py.
pytest will automatically detect all files starting with `test_` and include them in testing. In this case the only appropriate file is
`test_schemagraph.py`.
This file is implemented to accept test changes dynamically without touching the file itself. It fetches the inputs in terms of *files to test*
and the expected outputs for every test from the Excel sheet TestDefinitions.xlsx located in this directory.
To add a test case, you have to add a file to this sheet by adding a line containing the filename, the schema's expected depth, the schema's expected
resolved depth, the schema's expected has_recursions property, the schema's string count, the schema's maximum fan-in and the schema's reachability property.
Additionaly the test file has to be located in the subdirectory TestSchemas.
Additionaly the test file has to be located in the subdirectory `TestSchemas`.

## Test coverage

Expand Down

0 comments on commit 469e358

Please sign in to comment.