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 9079439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:50:14+00:00 2026-06-16T19:50:14+00:00

I am using nose to run a bunch of test cases. I would like

  • 0

I am using nose to run a bunch of test cases.
I would like to record output of each case to separate files, and to know result[success/failure] of each case. unfortunately, I can not figure out how to do it with nose. can anybody provide some clues? thank you

  • 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-06-16T19:50:15+00:00Added an answer on June 16, 2026 at 7:50 pm

    Firstly, this sounds like unusual usage, and may indicate that you should rethink your testing scheme.

    I can think of a couple of ways to address this. The simplest would be to have each test log itself instead of having nose do it for you. If you have only a few tests, or only care to log the results of a few tests, this would definitely be the way to do it.

    A more complex and general approach would be to write a nose plug-in that records the result of each test as it finishes. To do this, you’d want to write a plug-in that implements the afterTest() method.

    from nose.plugins import Plugin
    import datetime
    
    class SeparateReports(Plugin):
      "Log the results of each test into a separate file."
      def afterTest(self, test):
        logname = test.id() + '.log'
        success = test.passed
        date = datetime.datetime.now()
        # print logname, datetime.datetime.now(), success
        with open(logname, 'a') as log:
            log.write("%s: %s\n" % (date, success))
    

    This will append to a logfile named after your specific test a datestamp and True for success/False for failure. A couple of notes:

    • See the commented-out line for an example of the results that are printed.
    • This plug-in will have to be registered by nose; see the docs.
    • Once registered, the plug-in will have to be enabled; use the commandline option –with-separatereports (automagically generated based on the plug-in name).
    • This will be pretty slow since it is touching files for every test. You may want an sqlite DB that is open or something like that.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We started writing our functional and unit test cases in python using nose framework.
I am using Python Nose and would like to print the type of the
I am using python nose to run a bunch of doctests in subdirectories. The
I'm using django-nose and it does generate a huge coverage report. I would like
I current test uniqueness validations in rspec using something like the following: @unique =
I used unittest and nose for unit-testing in Python but now I'm using py.test.
I'm having some difficulty getting my django tests to run properly; I'm using nose,
I'm writing quite a few unit tests and using nosetests to run them. Nose
I'm trying to run tests in parallel using nose. I have setup a nose.cfg
I'm writing unit tests using nose , and I'd like to check whether a

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.