Skip to main content

rgf: red/green/refactor, a BDD framework for writing and running specs.

Project description

red / green / refactor
======================

A currently experimental attempt at an RSpec-esque BDD testing framework for Python.

Basically we're aiming for syntax along these lines:

```python
from rgf import describe, it

with describe("That Thing"):
@it("test desc")
def spec(context):
# test code here
assert stuff()
```

`x_spec.py` files go in a directory structure under, by convention, `spec/` in the
root of your project and are run using:

```bash
rgf spec
```


The specifics of the syntax are currently wrong, being borrowed directly from RSpec.
Suggestions warmly received.

(Current front-runners are `subject` and `context` in place of `describe`, keeping `it` for the spec decorator.)

Because the spec functions are just functions, not methods, and are hoovered up by the `@it` decorator they're
effectively anonymous and can all have the same name for ease of thinking:

```python
with subject('This Class'):
@it('can calculate X')
def s(world):
pass

@it('can account for Y')
def s(world):
pass
```


The aim is for something pythonic, with nested context and good spec names being the primary focus: minimum magic, minimum fuss.

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

rgf-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file rgf-0.0.1.tar.gz.

File metadata

  • Download URL: rgf-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rgf-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6199155f6c29e41eea76ddc2df6538a28ad3faabefccf1c0c4bd5b8d6c24102c
MD5 89252c44277a53dbe331d953510584df
BLAKE2b-256 e6a643f3125c30d77b6a18a63a4181d44a7ffe41146e30493cc0542354b6505d

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