Unit tests with app engine

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unit tests with app engine

WingIDE - User mailing list
Hello,

I'd appreciate help getting unit tests with app engine set up!

My project is set up like this:

MyProject/
-- app.yaml
-- main.py
-- tests/
---- unit_tests.py

Under Project Properties --> Testing I have done this:
-- Added tests/unit_tests.py as a Glob / Wild card pattern
-- Set the default test framework to Nose
-- Added --with-gae as a command line option

When I run the test from the testing tab, I get this error message:

AppConfigNotFoundError: ".../MyProject/tests" is a directory but does not contain app.yaml or app.yml or a WEB-INF subdirectory

The message is correct since my app.yaml is one level higher, but not sure what to do to fix my configuration.

Jeff



_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unit tests with app engine

WingIDE - User mailing list
Hi John,

You need to use a nose plugin called NoseGAE because app engine does weird stuff to the environment.  From the MyProject directory, I execute this on the command line:
    nosetests --with-gae tests/unit_tests.py
The --with-gae option activates the NoseGAE plugin.

I suspect that that the tests need to be executed from the MyProject directory but Wing is executing them from the tests directory.  Is there a way for Wing to execute the tests from the MyProject directory?

Jeff


_________________________________________________________
OpaVote -- Online elections for ranked-choice voting
Follow on Facebook and Google+ or via email.

On Mon, Sep 14, 2015 at 5:32 PM, Wing IDE Support <[hidden email]> wrote:
On 9/12/15 11:18 AM, Jeff O'Neill via wingide-users wrote:
Hello,

I'd appreciate help getting unit tests with app engine set up!

My project is set up like this:

MyProject/
-- app.yaml
-- main.py
-- tests/
---- unit_tests.py

Under Project Properties --> Testing I have done this:
-- Added tests/unit_tests.py as a Glob / Wild card pattern
-- Set the default test framework to Nose
-- Added --with-gae as a command line option

When I run the test from the testing tab, I get this error message:

How do you run your tests outside of Wing? I ask because I'm not familiar with tests for GAE.

Thanks,

John


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unit tests with app engine

WingIDE - User mailing list
On 9/14/15 6:40 PM, Jeff O'Neill via wingide-users wrote:
> You need to use a nose plugin called NoseGAE because app engine does
> weird stuff to the environment.  From the MyProject directory, I execute
> this on the command line:
>      nosetests --with-gae tests/unit_tests.py
> The --with-gae option activates the NoseGAE plugin.
>
> I suspect that that the tests need to be executed from the MyProject
> directory but Wing is executing them from the tests directory.  Is there
> a way for Wing to execute the tests from the MyProject directory?

You can set the run directory via the File Properties dialog on the
Testing tab -- create a launch configuration and specify the MyProjects
directory. Wing doesn't run nosetests from the command line, though,
because it needs a test runner that will send results back to the IDE to
display so may need to find an alternate method of enabling the NoseGAE
plugin.

Cheers,

John

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unit tests with app engine

WingIDE - User mailing list
I gave that a shot and it seems that I got past that error but now I'm getting another error that clearly requires getting into the nitty gritty of how app engine testing works...

I'll just keep doing my tests on the command line.

Thanks for the help.

Jeff


_________________________________________________________
OpaVote -- Online elections for ranked-choice voting
Follow on Facebook and Google+ or via email.

On Tue, Sep 15, 2015 at 10:42 AM, Wing IDE Support <[hidden email]> wrote:
On 9/14/15 6:40 PM, Jeff O'Neill via wingide-users wrote:
You need to use a nose plugin called NoseGAE because app engine does
weird stuff to the environment.  From the MyProject directory, I execute
this on the command line:
     nosetests --with-gae tests/unit_tests.py
The --with-gae option activates the NoseGAE plugin.

I suspect that that the tests need to be executed from the MyProject
directory but Wing is executing them from the tests directory.  Is there
a way for Wing to execute the tests from the MyProject directory?

You can set the run directory via the File Properties dialog on the Testing tab -- create a launch configuration and specify the MyProjects directory. Wing doesn't run nosetests from the command line, though, because it needs a test runner that will send results back to the IDE to display so may need to find an alternate method of enabling the NoseGAE plugin.

Cheers,

John



_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Loading...