Metadata-Version: 2.1
Name: tursu
Version: 0.6.2
Summary: A gherkin tests runner
Author-Email: Guillaume Gauvrit <guillaume@gauvr.it>
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Project-URL: Homepage, https://mardiros.github.io/tursu
Project-URL: Documentation, https://mardiros.github.io/tursu
Project-URL: Repository, https://github.com/mardiros/tursu.git
Project-URL: Issues, https://github.com/mardiros/tursu/issues
Project-URL: Changelog, https://mardiros.github.io/tursu/user/changelog.html
Requires-Python: >=3.10
Requires-Dist: gherkin-official>=32.0.0
Requires-Dist: pydantic>=2.10.6
Requires-Dist: pytest>=8.3.5
Requires-Dist: venusian<4,>=3.1.1
Provides-Extra: docs
Requires-Dist: furo>=2024.5.6; extra == "docs"
Requires-Dist: linkify-it-py<3,>=2.0.3; extra == "docs"
Requires-Dist: myst-parser<4,>=3.0.0; python_version < "3.10" and extra == "docs"
Requires-Dist: myst-parser<5,>=4.0.0; python_version >= "3.10" and extra == "docs"
Requires-Dist: sphinx<8,>=7.0.1; extra == "docs"
Requires-Dist: sphinx-autodoc2<1,>=0.5.0; extra == "docs"
Description-Content-Type: text/markdown

# Turşu

This project allows you to write **Gherkin**-based behavior-driven development (BDD) tests
and execute them using **pytest**.

It compiles Gherkin syntax into Python code using **Abstract Syntax Tree (AST)** manipulation,
enabling seamless integration with pytest for running your tests.

## Features

- Write tests using **Gherkin syntax** (Given, When, Then).
- Compile Gherkin scenarios to Python code using **AST**.
- Execute tests directly with **pytest**.
- Supports **step definitions** in Python for easy test scenario implementation.
- Allows integration with existing pytest setups.

## Getting started

### Installation using uv

```{bash}
uv add --group dev tursu
```

### Creating a new test suite

The simplest way to initialize a test suite is to run the tursu cli.

```
uv run tursu init
```

### Discover your tests.

```{bash}
𝝿 uv run pytest --collect-only tests/functionals2
=================== test session starts ===================
platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0
rootdir: <redacted>
configfile: pyproject.toml
plugins: cov-6.0.0
collected 3 items

<Dir dummy>
  <Dir tests>
    <Package functionals>
      <Module test_1_As_a_user_I_logged_in_with_my_password.py>
        <Function test_3_I_properly_logged_in>
        <Function test_7_I_hit_the_wrong_password>
        <Function test_14_I_user_another_login>
```

### Run the tests.

```{bash}
𝝿 uv run pytest tests/functionals2
=================== test session starts ===================
platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/guillaume/workspace/git/tursu
configfile: pyproject.toml
plugins: cov-6.0.0
collected 3 items

tests/functionals2/test_1_As_a_user_I_logged_in_with_my_password.py ... [100%]

===================== 3 passed in 0.02s ===================
```

### Gherkin keywords support.

tursu use the gherkin-official package to parse scenario, however,
they must be compiled to pytest tests function, implementation in development.

- ✅ Scenario
- ✅ Scenario Outlines / Examples
- ✅ Background
- ✅ Rule
- ✅ Feature
- ✅ Steps (Given, When, Then, And, But)
- ✅ Tags  (converted as pytest marker)
- ✅ Doc String
- ✅ Datatables
