Skip to content

Update database.rst #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update database.rst #591

wants to merge 1 commit into from

Conversation

cewing
Copy link
Contributor

@cewing cewing commented Apr 16, 2018

Add specific reference to primary/replica configuration for testing. It might help folks like me to recognize that this is another important instance of using multiple databases :)

This is pursuant to discussion on #429 about a place where not setting the mirror configuration for a db replica caused intermittent failures in pytest during teardown.

Add specific reference to primary/replica configuration for testing.  It might help folks like me to recognize that this is another important instance of using multiple databases :)
@codecov-io
Copy link

Codecov Report

Merging #591 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #591   +/-   ##
=======================================
  Coverage   91.92%   91.92%           
=======================================
  Files          33       33           
  Lines        1660     1660           
  Branches      143      143           
=======================================
  Hits         1526     1526           
  Misses         95       95           
  Partials       39       39
Flag Coverage Δ
#dj110 83.91% <ø> (ø) ⬆️
#dj111 86.08% <ø> (ø) ⬆️
#dj18 84.75% <ø> (ø) ⬆️
#dj19 83.79% <ø> (ø) ⬆️
#dj20 84.21% <ø> (ø) ⬆️
#djmaster 84.21% <ø> (ø) ⬆️
#mysql_innodb 84.21% <ø> (ø) ⬆️
#mysql_myisam 84.15% <ø> (ø) ⬆️
#postgres 87.59% <ø> (ø) ⬆️
#py27 89.21% <ø> (ø) ⬆️
#py34 83.79% <ø> (ø) ⬆️
#py35 83.91% <ø> (ø) ⬆️
#py36 84.69% <ø> (ø) ⬆️
#sqlite 85.96% <ø> (ø) ⬆️
#sqlite_file 83.79% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50063c4...645e2c0. Read the comment docs.

@cewing
Copy link
Contributor Author

cewing commented Jul 1, 2018

@blueyed, I wonder if there is any chance of this PR getting merged. The specific reference to primary/replica db setups would have saved me a bit of time, and I'm sure it will save other folks time as well. Is there anything I can do to facilitate getting this in?

@blueyed
Copy link
Contributor

blueyed commented Jul 2, 2018

Thanks for caring about docs, and sorry for the late reply.

What about this patch on top?

diff --git c/docs/database.rst i/docs/database.rst
index 3f9d1ad..5714e12 100644
--- c/docs/database.rst
+++ i/docs/database.rst
@@ -71,17 +71,20 @@ Tests requiring multiple databases
 ----------------------------------
 
 Currently ``pytest-django`` does not specifically support Django's
-multi-database support.  You can however use normal Django
-``TestCase`` instances to use it's `multi_db
-<https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#tests-and-multiple-databases>`_
-support. In particular, if your database is configured for replication, be sure to read
-about `testing primary/replica configurations <https://docs.djangoproject.com/en/2.0/topics/testing/advanced/#testing-primary-replica-configurations>`_. 
+multi-database support.
+
+You can however use normal :class:`~django.test.TestCase` instances to use its
+:ref:`django:topics-testing-advanced-multidb` support.
+In particular, if your database is configured for replication, be sure to read
+about :ref:`django:topics-testing-primaryreplica`.
 
 If you have any ideas about the best API to support multiple databases
 directly in ``pytest-django`` please get in touch, we are interested
 in eventually supporting this but unsure about simply following
 Django's approach.
 
+See `https://github.com/pytest-dev/pytest-django/pull/431` for an idea /
+discussion to approach this.
 
 ``--reuse-db`` - reuse the testing database between test runs
 --------------------------------------------------------------

@blueyed
Copy link
Contributor

blueyed commented Jul 2, 2018

Renders as:

2018-07-02-222753_740x343_escrotum

old (your original PR):

2018-07-02-222557_755x256_escrotum

(this uses the new theme I've just merged)

@cewing
Copy link
Contributor Author

cewing commented Jul 10, 2018

@blueyed I love it. That's fantastic! Thanks so much for the update. It will really help to find the right documentation to solve a non-obvious failure mode!

@blueyed blueyed closed this in f1bc024 Jul 10, 2018
@blueyed
Copy link
Contributor

blueyed commented Jul 10, 2018

Great!
Merged in f1bc024 - you get the credit for the initial PR and the review.. :)

beyondgeeks pushed a commit to beyondgeeks/django-pytest that referenced this pull request Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants