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

  • Home
  • SEARCH
  • 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 9259717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:43:18+00:00 2026-06-18T12:43:18+00:00

I am using to run tests for my django application pytest with pytest-django plugin.

  • 0

I am using to run tests for my django application pytest with pytest-django plugin. I use MySQL database as a default one for django. Is there possiblity to specify just for pytest to use different database for tests, SQLite?

I am looking for different option if any, than creating special test_seetings.py for py.test –ds=test_settings.

  • 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-18T12:43:19+00:00Added an answer on June 18, 2026 at 12:43 pm

    --ds=test_settings is the way to go!

    If you dont want to type out --ds=... every time you invoke py.test, you can add a pytest.ini with this contents:

    [pytest]
    DJANGO_SETTINGS_MODULE = test_settings
    

    As a side note: It is good practice to use the same type of database that you use in production when running your tests. pytest-django provides the --reuse-db option to re-use a MySQL/Postgres database between test runs, saving a lot of setup time when running a few tests for projects with lots of models.

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

Sidebar

Related Questions

We are using NUnit to run our integration tests. One of tests should always
I am struggling to run unit tests using the Django Client class on the
I would like to run all my django tests using mercurial's precommit hook. Whenever
I have a Django application, myApp. In it, there's a tests.py file which defines
I'm having some difficulty getting my django tests to run properly; I'm using nose,
i'm using Django to develop a web application. When i try and run it
I'm using Marthon to run tests on a Java Swing application. I build the
I wanna run selenium tests from TeamCity using Maven at Linux server without display.
I am using rspec and cucumber to run watir tests at sauce labs. I
I'm trying to run unit tests written in QUnit using jsTestDriver. I'm getting ReferenceError:

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.