Skip to main content

A gherkin tests runner

Project description

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

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.

𝝿 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.

𝝿 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
  • ✅ Background
  • ✅ Rule
  • ✅ Feature
  • ✅ Steps (Given, When, Then, And, But)
  • ✅ Tags (converted as pytest marker)
  • ✅ Doc String
  • ❌ Scenario Outlines / Examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tursu-0.5.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tursu-0.5.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file tursu-0.5.1.tar.gz.

File metadata

  • Download URL: tursu-0.5.1.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.22.4 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for tursu-0.5.1.tar.gz
Algorithm Hash digest
SHA256 aeae5038c0865211658643997cfe60dba371c0301c400b36ace785c74556188a
MD5 8b02049ebe47fa12ffa4e1dd0f8e8cf6
BLAKE2b-256 33d839656d409e1a8994fe88959160f1454d4f2964d98f4cdabe85d8bdde00f5

See more details on using hashes here.

File details

Details for the file tursu-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: tursu-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.22.4 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for tursu-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84bc480a57c960cd0cd55791ede3c87b1aa24354e7334a8dfe8ce4ab57df0412
MD5 af2c25518263b40c805bd97705881e7a
BLAKE2b-256 9f37ed86c255abbf7617896e730cd039e48548d3ff0c90e0747e42cba45dbace

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page