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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:41:40+00:00 2026-06-10T09:41:40+00:00

I am using pyramids framework for large project and I find it messy to

  • 0

I am using pyramids framework for large project and I find it messy to have all my tests in one tests.py file. So I have decided to create directory that would contain files with my tests. Problem is, I have no idea, how to tell pyramids, to run my tests from this directory.

I am running the tests using python setup.py test -q.

But this of course do not work, after I have moved my tests into tests directory. What to do, to make it work?

  • 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-10T09:41:41+00:00Added an answer on June 10, 2026 at 9:41 am

    First, you need to make sure tests is not just a directory, but a Python package by creating an __init__.py in it.

    You also need to make sure you name the modules in your tests package test_something.py.

    Most test runners, as part of their test discovery, look for a module or package named tests, modules in that package starting with test_ and expect method names for test methods (on TestCase subclasses) to start with test_.

    The unittest module describes test runners as:

    A test runner is a component which orchestrates the execution of tests
    and provides the outcome to the user. The runner may use a graphical
    interface, a textual interface, or return a special value to indicate
    the results of executing the tests.

    There are plenty of different testing frameworks and hence test runners out there, most extending unittest in some way and looking for unittest.TestCase subclasses. They may do different types of test discovery, present the results in a different way or gather code coverage while the tests are being run.

    As for relative imports: You should really try to avoid these. They make it harder to move code around (as you just noticed) and decrease the readability of the imports (where does what code get imported from?). Just use from myproject.views import my_view – it’s a lot clearer where things live

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

Sidebar

Related Questions

I am building a Form object using pyramid_simpleform. I would like to have one
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
I have a pyramid project using the formalchemy admin interface. I added the basic
I am practicing with Python using Pyramid framework. I created a py, myfuncs.py ,
I am using latest Pyramid to build a web app. Somehow we have started
I'm working on a Pyramid project using Mako templates, and I'm trying to display
I'm using Pyramid framework and I want to access the IP address from which
I'd like to validate uploaded file's size in my Pyramid application using formencode. As
I am starting a web project in Python, most likely using Django or Pyramid.
I'm trying to implement email confirmation using Pyramid framework. Here's the code that confirms

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.