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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:09:54+00:00 2026-06-09T17:09:54+00:00

Ok, so what i am trying to do is i have a bunch of

  • 0

Ok, so what i am trying to do is i have a bunch of python programs that are just tests (using the unittest library). I would like to create a python program that runs each python program back to back and gives me kind of a report at the end (would be the best situation) or just stops running if one fails.

The hard part about this is each program requires a user input (a simple Y for yes). How can I run each python program (i have run across the executefile("script.py") command but have not tested it out), then insert the input from the user (a simple Y), and either have it stop when a test fails (easier) or preferably be able to tell which ones fail and print the results of what failed and what passed after they all run.

I am still learning python (self-taught) so sorry!

  • 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-09T17:09:55+00:00Added an answer on June 9, 2026 at 5:09 pm

    Have you tried to use the unittest module to run all your tests?

    % python -m unittest -h
    Usage: python -m unittest [options] [tests]
    
    Options:
      -h, --help       Show this message
      -v, --verbose    Verbose output
      -q, --quiet      Minimal output
      -f, --failfast   Stop on first failure
      -c, --catch      Catch control-C and display results
      -b, --buffer     Buffer stdout and stderr during test runs
    
    Examples:
      python -m unittest test_module               - run tests from test_module
      python -m unittest module.TestClass          - run tests from module.TestClass
      python -m unittest module.Class.test_method  - run specified test method
    
    [tests] can be a list of any number of test modules, classes and test
    methods.
    
    Alternative Usage: python -m unittest discover [options]
    
    Options:
      -v, --verbose    Verbose output
      -f, --failfast   Stop on first failure
      -c, --catch      Catch control-C and display results
      -b, --buffer     Buffer stdout and stderr during test runs
      -s directory     Directory to start discovery ('.' default)
      -p pattern       Pattern to match test files ('test*.py' default)
      -t directory     Top level directory of project (default to
                       start directory)
    
    For test discovery all test modules must be importable from the top
    level directory of the project.
    

    Documentation:

    • http://docs.python.org/py3k/library/unittest.html#command-line-interface
    • http://docs.python.org/py3k/library/unittest.html#test-discovery
    • http://docs.python.org/py3k/library/unittest.html#unittest.TextTestRunner
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put a bunch of (x,y) points on a map, that have
I am trying to create a bunch of directories/subdirectories that I can copy files
I have a bunch of classes that I am trying to refactor and abstract
I have a bunch of divs I'm trying to organize here. The ones I'm
I'm trying to have a page with a bunch of buttons, each of which
I have a bunch of links with the class name row. What I'm trying
I am trying to have a table like this: Manager Expert Adminis. Staff Dept
I've been trying to write an extend function so I can have bunch of
I am trying to build an app which will have a bunch of cards
I have a system set up currently that is using celery with a redis

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.