[TIP] pytest in the Python shell

Isaac Gonzalez isaac at kiip.me
Wed Aug 1 15:02:26 PDT 2012

On Wed, Aug 1, 2012 at 2:54 PM, Ronny Pfannschmidt
<Ronny.Pfannschmidt at gmx.de> wrote:
> Hi,
> Python itself does not have safe code reloading,
> its strongly suggested to just run new processes

I see.

> and also the reason why py.test does not include such a tool
> its just too easy to get strange breakages
> whats wrong with just running a suboprocess or py.test from the normal
> shell?

I want to be able to use an interactive shell so I'll go with the
subprocess option. Thanks! I hadn't thought of that.


> -- Ronny
> On 08/01/2012 11:33 PM, Isaac Gonzalez wrote:
>> Hi!
>> I am running pytest from within the Python shell. For instance:
>> pytest.main('tests/api')
>> When I change the test file inside the folder, to fix the test, the
>> python shell and pytest seems to have cached the results of the test
>> and gives the same output when I re-run the above command.
>> If I restart the shell it reads the file again and gives the new
>> output from the test. Is there a way to have pytest reload the test
>> with out restarting the shell and importing pytest again?
>> Thanks!
>> _______________________________________________
>> testing-in-python mailing list
>> testing-in-python at lists.idyll.org
>> http://lists.idyll.org/listinfo/testing-in-python

More information about the testing-in-python mailing list