/anaphora

An agnostic, flexibly-expressive scaffold for structured testing

Primary LanguagePythonMIT LicenseMIT

anaphora: An agnostic, flexibly-expressive scaffold for structured testing

anaphora is for adding structure and semantics to your test runs. It doesn't come with strong opinions about what grammar, meaning, or kind of tests will be right for your teams and projects. Instead, anaphora lets you define these as you go.

This agnosticism extends to what a test should look like. While the canonical test is written into the anaphora file (with plain assertions or any assertion library you prefer), there's also a simple API for running tests elsewhere. This makes it easy to select, filter (via a predicate callable), and run:

  • all functions in a given module
  • only functions in a module that start with "test"
  • all methods on all classes
  • only methods that start with "test" on classes that end with "Test"
  • other command-line executables (like linters, tests for other languages in your project, etc.)

Taken together, these features mean an anaphora run could integrate linters with behavior, regression, and unit tests.

Requirements

anaphora requires Python 3 to run, and pip for Python 3 to install additional dependencies.

Getting started

anaphora is still nascent enough that it isn't quite released and as such has no version. The initial tagged release will come as soon as anaphora has been given a good workout, but a quick look in tests/* should be enough to show you how to put it through the paces yourself.

Documentation

Coming soon.

Assertions

Even though you can use whatever assertions you like with anaphora, expressive assertions are probably the best fit. If you don't already have a favorite, these are a good place to start looking:

Others you may find worth a look include: PyHamcrest and PyShould