Minimal example¶
This is the simplest example of using HardPy.
This code shows how to convert any pytest tests into a HardPy project.
To achieve this, a hardpy.toml file containing the minimum required information must be added.
Data from this project will be saved in a JSON document in the .hardpy/runstore directory.
The code for this example can be seen inside the hardpy package Minimal example.
how to start¶
- Install the hardpy from pypi:
pip install hardpy - Copy the hardpy.toml file to the tests directory.
- Launch HardPy:
hardpy run <tests_directory> - Open
http://localhost:8000/
test_1.py¶
def test_one():
assert True
hardpy.toml¶
[database]
storage_type = "json"
[frontend]
host = "localhost"
port = 8000