From c033f90f4b5d756eef92d203cdc1e29392278468 Mon Sep 17 00:00:00 2001 From: Ahmed Waheed Date: Fri, 26 May 2023 01:57:33 +0500 Subject: [PATCH 1/2] Create readme.md --- readme.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..103746a --- /dev/null +++ b/readme.md @@ -0,0 +1,33 @@ +# pytest-read-json-example + +This repository provides an example of how to read JSON data in Pytest using various methods. It demonstrates five different techniques to Read JSON Data in Pytest + +## Requirements + +- Python +- Pytest +- Black + +## How to Run the Unit Tests + + - Clone the GitHub repository: +```bash + git clone [https://github.com/ericsalesdeandrade/pytest-read-json-example.git](https://github.com/ericsalesdeandrade/pytest-read-json-example.git) +``` + + - Navigate to the project directory: +```bash + cd pytest-read-json-example +``` + - Create a virtual environment, activate it and install the requirements: +``` bash +python -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` +To run the tests execute the following command +```bash +pytest tests/unit/test_read_json.py -v -s --input-json='{"name": "Ravi", "age": 90, "city": "New Delhi"}' +``` + + From 619edb468bb16d7890801eb782e32ac8b2d1ccc9 Mon Sep 17 00:00:00 2001 From: Ahmed Waheed Date: Fri, 26 May 2023 01:59:35 +0500 Subject: [PATCH 2/2] Update readme.md --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 103746a..61c6e5f 100644 --- a/readme.md +++ b/readme.md @@ -12,12 +12,12 @@ This repository provides an example of how to read JSON data in Pytest using var - Clone the GitHub repository: ```bash - git clone [https://github.com/ericsalesdeandrade/pytest-read-json-example.git](https://github.com/ericsalesdeandrade/pytest-read-json-example.git) +git clone [https://github.com/ericsalesdeandrade/pytest-read-json-example.git](https://github.com/ericsalesdeandrade/pytest-read-json-example.git) ``` - Navigate to the project directory: ```bash - cd pytest-read-json-example +cd pytest-read-json-example ``` - Create a virtual environment, activate it and install the requirements: ``` bash