Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 389685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:53:28+00:00 2026-05-12T15:53:28+00:00

nosetest is the default test framework in Turbogeras 2.0. The application has a websetup.py

  • 0

nosetest is the default test framework in Turbogeras 2.0. The application has a websetup.py module that initialise the database. I use mysql for my development and production environment and websetup works fine, but nosetest uses sqlite on memory and when it tries to initialise the DB sends an error:

TypeError: SQLite Date, Time, and
DateTime types only accept Python
datetime objects as input.

I’ve detected when this happens and is in the import fase:

csvreader = csv.reader(open('res/products.csv'), delimiter=",", quotechar="'")
for row in csvreader:
    p = model.Product(row[1], row[2], row[3], row[4] + ".jpg")
    # Even tried to convert the date to a sqlalchemy type
    # need to put a conditional here, when testing I don't care this date
    import sqlalchemy
    dateadded = sqlalchemy.types.DateTime(row[5])
    p.dateAdded = dateadded
    p.brand_id = row[6]
    p.code = row[3]

    ccat = model.DBSession.query(model.Category)\
        .filter(model.Category.id==int(row[8]) + 3).one()

    p.categories.append(ccat)

    p.normalPrice = row[9]
    p.specialPrice = row[10]
    p.discountPrice = row[11]

    model.DBSession.add(p)

How can I tell when nosetest is running? I’ve try:

if globals().has_key('ModelTest'):

and

if vars().has_key('ModelTest'):

The first one with no results and the second one with error

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:53:28+00:00Added an answer on May 12, 2026 at 3:53 pm

    Presumably if nose is running, the ‘nose’ top-level module will have been imported. You should be able to test that with

    if 'nose' in sys.modules:
        print "Nose is running, or at least has been imported!"
        #or whatever you need to do if nose is running
    

    Of course this is not a foolproof test, which assumes that there’s no other reason why nose would be imported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use nosetests to run all test cases inside my project.
I am building an application with Python 2.7 using the Google App Engine framework.
I am running python nosetests on a foreign module. The dots mean that a
It seems that python nosetest will quit when encountered sys.exit() , and mocking of
I have a nose test that imports a file which runs a class with
I am writing a test application which consists of: 2 buttons 1 Edittext 1
Is it possible to run nose test generators inside custom classes? I am trying
I would like to be able to run a nose test script which accepts
When I test https://bitbucket.org/petar/beam_integrals with python setup.py nosetests I get a 96% coverage :
I'm use nosetests to run some tests. However, after the tests have finished running,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.