Juan Carlos Coto
Juan Carlos Coto

Reputation: 12564

Python unit testing for existing project to set up BDD

We might be interested in starting to incorporate a unit test suite to our project, which is coded in Python (and it uses Redis, PostgreSQL and some third-party libraries, if that bears into the solution). The benefits we want to achieve are:

  1. Once the project is up to speed, we want to be able to specify new behavior quickly and efficiently, to help improve communication and team productivity. Read: We want BDD, but have already started coding without it.
  2. Excellent textual support (i.e. the tests can be read almost as natural text), so as to make it easier to write and read tests.
  3. Ability to automatically run tests (at the very least, to be able to include the running in a Bash script or something like that). We use Windows and Linux for development, and Linux servers, so Linux support is our primary requirement.
  4. Integration with github. I don't know if it is possible, but I've seen some projects in github which have a "Passing" or "Failing" status on them and it would be great to have that for our project.

What are good tools / libraries that can help us do this, and, most importantly, what are good ways to incorporate BDD into a Python project?

Thank you very much! Any suggestions are appreciated.

Upvotes: 4

Views: 539

Answers (2)

weaver
weaver

Reputation: 1983

I searched high and low for something small, literate, and non-magical to do testing in Python, and could find nothing, so I came up with https://github.com/kislyuk/ensure.

You'll need to use another test framework to structure your tests around it (personally, I'm quite content with unittest), and it doesn't have github integration, which I think you're better off using Travis for.

Upvotes: 1

jary
jary

Reputation: 1213

I quite liked:

You may find more by searching:

pip search bdd

Upvotes: 4

Related Questions