librelist archives

« back to archive

Running Flask-Testing tests

Running Flask-Testing tests

From:
dalan.miller@gmail.com
Date:
2012-07-20 @ 02:42
Hey all,

I'm a little bit confused as to how one is supposed to initiate a test
class created with Flask-Testing?

I've written out my class and it looks something like this -
http://hastebin.com/niwuwagubi.py

But how would I for example, start the main app and then run the tests
against it? Or is that not how it is supposed to work?

I should mention that I'm also kind of new to Python testing.

Thank you,

Daniel

Re: [flask] Running Flask-Testing tests

From:
Redouane Zait
Date:
2012-07-20 @ 05:00
use a test runner like nose http://nose.readthedocs.org/en/latest/
also, you don't need to have the app running to test it.

On Fri, Jul 20, 2012 at 3:42 AM, dalan.miller@gmail.com <
dalan.miller@gmail.com> wrote:

> Hey all,
>
> I'm a little bit confused as to how one is supposed to initiate a test
> class created with Flask-Testing?
>
> I've written out my class and it looks something like this -
> http://hastebin.com/niwuwagubi.py
>
> But how would I for example, start the main app and then run the tests
> against it? Or is that not how it is supposed to work?
>
> I should mention that I'm also kind of new to Python testing.
>
> Thank you,
>
> Daniel
>
>

Re: [flask] Running Flask-Testing tests

From:
dalan.miller@gmail.com
Date:
2012-07-20 @ 06:19
So I would just pip install nose and then just run nosetests within the
project directory and it would run fine? Nose is able to work well with
Flask-Testing just like that?

Daniel

On Thu, Jul 19, 2012 at 10:00 PM, Redouane Zait <unrealdz@gmail.com> wrote:

> use a test runner like nose http://nose.readthedocs.org/en/latest/
> also, you don't need to have the app running to test it.
>
>
> On Fri, Jul 20, 2012 at 3:42 AM, dalan.miller@gmail.com <
> dalan.miller@gmail.com> wrote:
>
>> Hey all,
>>
>> I'm a little bit confused as to how one is supposed to initiate a test
>> class created with Flask-Testing?
>>
>> I've written out my class and it looks something like this -
>> http://hastebin.com/niwuwagubi.py
>>
>> But how would I for example, start the main app and then run the tests
>> against it? Or is that not how it is supposed to work?
>>
>> I should mention that I'm also kind of new to Python testing.
>>
>> Thank you,
>>
>> Daniel
>>
>>
>

Re: [flask] Running Flask-Testing tests

From:
Christoph Heer
Date:
2012-07-20 @ 09:54
Hi,

should work with nose and unittest2. You are right just install nose
via pip and run nosetests in your project directory.
The Flask-Testing documentation should contains more informations
about "How I run tests". I'm working on this failures. Pull Requests
are welcome ;)

Best regards,
Christoph


PS: I'm the maintainer of Flask-Testing ;)

2012/7/20 dalan.miller@gmail.com <dalan.miller@gmail.com>:
> So I would just pip install nose and then just run nosetests within the
> project directory and it would run fine? Nose is able to work well with
> Flask-Testing just like that?
>
> Daniel
>
>
> On Thu, Jul 19, 2012 at 10:00 PM, Redouane Zait <unrealdz@gmail.com> wrote:
>>
>> use a test runner like nose http://nose.readthedocs.org/en/latest/
>> also, you don't need to have the app running to test it.
>>
>>
>> On Fri, Jul 20, 2012 at 3:42 AM, dalan.miller@gmail.com
>> <dalan.miller@gmail.com> wrote:
>>>
>>> Hey all,
>>>
>>> I'm a little bit confused as to how one is supposed to initiate a test
>>> class created with Flask-Testing?
>>>
>>> I've written out my class and it looks something like this -
>>> http://hastebin.com/niwuwagubi.py
>>>
>>> But how would I for example, start the main app and then run the tests
>>> against it? Or is that not how it is supposed to work?
>>>
>>> I should mention that I'm also kind of new to Python testing.
>>>
>>> Thank you,
>>>
>>> Daniel
>>>
>>
>

Re: [flask] Running Flask-Testing tests

From:
Igor Davydenko
Date:
2012-07-20 @ 10:23
Hi, Cristoph

Thanks for Flask-Testing, and it would be really nice to have a
section "How I run tests" in documentation! Today after reading this
thread, I didn't believe that this section missed in docs ;)

On 20 July 2012 12:54, Christoph Heer <christoph.heer@googlemail.com> wrote:
> Hi,
>
> should work with nose and unittest2. You are right just install nose
> via pip and run nosetests in your project directory.
> The Flask-Testing documentation should contains more informations
> about "How I run tests". I'm working on this failures. Pull Requests
> are welcome ;)
>
> Best regards,
> Christoph
>
>
> PS: I'm the maintainer of Flask-Testing ;)
>

-- 
Sincerely,
Igor Davydenko

Re: [flask] Running Flask-Testing tests

From:
dalan.miller@gmail.com
Date:
2012-07-20 @ 20:23
So I installed nose and in my project now have a folder called "tests"

$ nosetests tests

returns

----------------------------------------------------------------------
Ran 0 tests in 0.003s

OK


And my code looks like this and is in a file called
test.py.<http://hastebin.com/yobeqediwo.py>(Which is in the tests
folder)

Why isn't nose picking up the flask-testing tests? I know this has to be
extremely obvious, I'm just ultra noob when it comes to this =/. Thank you
all for your help.

Daniel


On Fri, Jul 20, 2012 at 3:23 AM, Igor Davydenko
<playpauseandstop@gmail.com>wrote:

> Hi, Cristoph
>
> Thanks for Flask-Testing, and it would be really nice to have a
> section "How I run tests" in documentation! Today after reading this
> thread, I didn't believe that this section missed in docs ;)
>
> On 20 July 2012 12:54, Christoph Heer <christoph.heer@googlemail.com>
> wrote:
> > Hi,
> >
> > should work with nose and unittest2. You are right just install nose
> > via pip and run nosetests in your project directory.
> > The Flask-Testing documentation should contains more informations
> > about "How I run tests". I'm working on this failures. Pull Requests
> > are welcome ;)
> >
> > Best regards,
> > Christoph
> >
> >
> > PS: I'm the maintainer of Flask-Testing ;)
> >
>
> --
> Sincerely,
> Igor Davydenko
>

Re: [flask] Running Flask-Testing tests

From:
Christoph Heer
Date:
2012-07-20 @ 20:46
Hi Daniel,

normally nose look for classes and functions which start with "Test".
Rename your TestCase class to TestSuper instead of SuperTest and run nose
again this should work.

Christoph

On 20.07.2012, at 22:25, "dalan.miller@gmail.com" <dalan.miller@gmail.com>
wrote:

So I installed nose and in my project now have a folder called "tests"

$ nosetests tests

returns

----------------------------------------------------------------------
Ran 0 tests in 0.003s

OK


And my code looks like this and is in a file called
test.py.<http://hastebin.com/yobeqediwo.py>(Which is in the tests
folder)

Why isn't nose picking up the flask-testing tests? I know this has to be
extremely obvious, I'm just ultra noob when it comes to this =/. Thank you
all for your help.

Daniel


On Fri, Jul 20, 2012 at 3:23 AM, Igor Davydenko
<playpauseandstop@gmail.com>wrote:

> Hi, Cristoph
>
> Thanks for Flask-Testing, and it would be really nice to have a
> section "How I run tests" in documentation! Today after reading this
> thread, I didn't believe that this section missed in docs ;)
>
> On 20 July 2012 12:54, Christoph Heer <christoph.heer@googlemail.com>
> wrote:
> > Hi,
> >
> > should work with nose and unittest2. You are right just install nose
> > via pip and run nosetests in your project directory.
> > The Flask-Testing documentation should contains more informations
> > about "How I run tests". I'm working on this failures. Pull Requests
> > are welcome ;)
> >
> > Best regards,
> > Christoph
> >
> >
> > PS: I'm the maintainer of Flask-Testing ;)
> >
>
> --
> Sincerely,
> Igor Davydenko
>

Re: [flask] Running Flask-Testing tests

From:
Redouane Zait
Date:
2012-07-20 @ 22:31
same for the methods, rename assertHome to something like test_home

On Fri, Jul 20, 2012 at 9:46 PM, Christoph Heer <
christoph.heer@googlemail.com> wrote:

> Hi Daniel,
>
> normally nose look for classes and functions which start with "Test".
> Rename your TestCase class to TestSuper instead of SuperTest and run nose
> again this should work.
>
> Christoph
>
>
> On 20.07.2012, at 22:25, "dalan.miller@gmail.com" <dalan.miller@gmail.com>
> wrote:
>
> So I installed nose and in my project now have a folder called "tests"
>
> $ nosetests tests
>
> returns
>
> ----------------------------------------------------------------------
> Ran 0 tests in 0.003s
>
> OK
>
>
> And my code looks like this and is in a file called 
test.py.<http://hastebin.com/yobeqediwo.py>(Which is in the tests folder)
>
> Why isn't nose picking up the flask-testing tests? I know this has to be
> extremely obvious, I'm just ultra noob when it comes to this =/. Thank you
> all for your help.
>
> Daniel
>
>
> On Fri, Jul 20, 2012 at 3:23 AM, Igor Davydenko <
> playpauseandstop@gmail.com> wrote:
>
>> Hi, Cristoph
>>
>> Thanks for Flask-Testing, and it would be really nice to have a
>> section "How I run tests" in documentation! Today after reading this
>> thread, I didn't believe that this section missed in docs ;)
>>
>> On 20 July 2012 12:54, Christoph Heer <christoph.heer@googlemail.com>
>> wrote:
>> > Hi,
>> >
>> > should work with nose and unittest2. You are right just install nose
>> > via pip and run nosetests in your project directory.
>> > The Flask-Testing documentation should contains more informations
>> > about "How I run tests". I'm working on this failures. Pull Requests
>> > are welcome ;)
>> >
>> > Best regards,
>> > Christoph
>> >
>> >
>> > PS: I'm the maintainer of Flask-Testing ;)
>> >
>>
>> --
>> Sincerely,
>> Igor Davydenko
>>
>
>