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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:15:15+00:00 2026-06-18T22:15:15+00:00

How can you run tests from all TestCase classes, in a specific module under

  • 0

How can you run tests from all TestCase classes, in a specific module under tests package?

In a Django project, I have split tests.py under tests/
Each file(module) has several TestCase classes, and each of them having several test methods.
init.py imports each of them.

I already know that I can do these:

  1. Run all the test:

    ./manage.py test myapp
    
  2. Or run specific TestCase:

    ./manage.py test myapp.OneOfManyTestCase    
    
  3. Or run very specific test method from a TestCase class:

    ./manage.py test myapp.OneOfManyTestCase.test_some_small_method
    

However, I can’t figure out how to run every TestCases from a particular module.
Say, OneOfManyTestCase class is from tests/lot_of_test.py, and there are other test cases too.
Django doesn’t seem to care about modules with TestCases.

How can I run all the TestCases inside lot_of_test?

  • 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-18T22:15:17+00:00Added an answer on June 18, 2026 at 10:15 pm

    I ended up writing down my own TestSuiteRunner, like @sneawo said.

    After Django-style fails, try importing as usual python-style.

    One line to fix:

    suite.addTest(build_test(label))
    

    into

    try:
        suite.addTest(django.test.simple.build_test(label))
    except ValueError:
        # change to python-style package name
        head, tail = label.split('.', 1)
        full_label = '.'.join([head, django.test.simple.TEST_MODULE, tail])
        # load tests
        tests = unittest.defaultTestLoader.loadTestsFromName(full_label)
        suite.addTests(tests)
    

    and set TEST_RUNNER in settings.py:

    TEST_RUNNER='myapp.tests.module_test_suite_runner.ModuleTestSuiteRunner'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From Eclipse I can easily run all the JUnit tests in my application. I
I have switched to JUnit4.4 from JUnit3.8. I run my tests using ant, all
In TestDriven.Net I can set the following from the TestDriven.Net Options Pane Run tests
How can you run AsUnit test runner from Ant? I'm on the Mac OS
I want to write a CMakeLists.txt so that I can run my tests normally
Can I run nUnit tests in Visual Studio (for instance)?
I can run tasks as part of our functional tests just fine using this
With selenium can one run a test which check all images on a current
I know that to run junit from command line you can do this: java
I would like a seperate class to run all of my tests, and then

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.