py.test

Preferred Python unit-testing framework

Hello, So far I've been using the built-in unittest module for unit-testing Python code. However, for simple cases it seems like an overkill. Being a derivative of xUnit, it appears a bit heavy for the dynamic nature of Python, where I would expect to write less to achieve the same effects. On the other hand, it is built-in, makes you w...

Having trouble with py.test remote

I love py.test and am trying to get the remote test execution feature to work so I can run tests on a remote machine. There is very little doc and I am getting frustrated with it. Any help figuring out what I am doing wrong is appreciated. Here is my command line on the main server: c:\Python26\Scripts\py.test --dist=each --tx socket...

Running py.test from emacs

What I would like if for C-c C-c to run py.test and display the output in the other buffer if the name of the file being edited begins with test_ and to normally run py-execute-buffer otherwise. How would I do this? I am using emacs 23.1.1 with python-mode and can access py.test from the command line. ...

How to accumulate state across tests in py.test

I currently have a project and tests similar to these. class mylib: @classmethod def get_a(cls): return 'a' @classmethod def convert_a_to_b(cls, a): return 'b' @classmethod def works_with(cls, a, b): return True class TestMyStuff(object): def test_first(self): self.a = mylib...

How to use py.test from Python?

I'm working in a project that recently switched to the py.test unittest framework. I was used to call my tests from Eclipse, so that I can use the debugger (e.g. placing breakpoints to analyze how a test failure develops). Now this is no longer possible, since the only way to run the tests is via the command line blackbox. Is there some...

Projects using py.test

I am looking for (list of) projects that use py.test. I am new to testing, and want to use py.test. I need examples from projects, so i can use py.test extensively. The documentation is good for py.test but is too fragmented to get a good grasp. I have a vague idea of how it works. I saw the py.test video(3hrs) from pycon. But need some...

How to make py.test or nose to look for tests inside all python files?

I do have several small modules where the tests are inside them and py.test or nose does not look for them because they do not contain test in their filename. How can I convince py.test or nose to look for tests inside all python files, recursively - '''including the ones that do not have test in their filenames'''? Inside the source f...

Possible to use unittest-like fixtures in py.test?

I really like py.test, but I am having lots of difficulty understanding how funcargs work. Is it possible to use a command line argument or an extension to enable the use of something that performs a similar role to unittest.TestCase.setUp and unittest.TestCase.tearDown? ...

Turbogears2 and py.test

I'm switching our testing environment from Nose to py.test for testing a Turbogears2 web application. Currently, when Nose runs it gathers information from a testing configuration file (test.ini) that holds all the testing variables the application needs. And it seems to do so in an automatic way (I'm simply running nosetests and everyt...

py.test with non-python tests (specifically, with cxxtest)

Hi, I work with a team that develops MPI-based C++ numerical applications. The group uses cxxtest for constructing individual unit tests or small suites, but 1) there are some complications aggregating across directories with cxxtest's usual features and 2) there are some integration tests that are simply easier to implement "from the ou...