Skip to content

Commit 3d4d3cb

Browse files
authored
Merge pull request #8882 from readthedocs/sep-debug-reaq
2 parents 1d6cd99 + 84a2f28 commit 3d4d3cb

File tree

7 files changed

+26
-21
lines changed

7 files changed

+26
-21
lines changed

dockerfiles/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
5050
WORKDIR /tmp
5151

5252
COPY requirements/pip.txt pip.txt
53+
COPY requirements/debug.txt debug.txt
5354
COPY requirements/docker.txt docker.txt
5455
RUN pip3 install --no-cache-dir -r docker.txt
5556

docs/dev/tests.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ paths. Before testing, make sure you have Tox installed:
1313

1414
.. prompt:: bash
1515

16-
pip install tox
16+
pip install tox
1717

1818
To run the full test and lint suite against your changes, simply run Tox. Tox
1919
should return without any errors. You can run Tox against all of our
2020
environments by running:
2121

2222
.. prompt:: bash
2323

24-
tox
24+
tox
2525

2626
By default, tox won't run tests from search,
2727
in order to run all test including the search tests,
@@ -31,7 +31,7 @@ you can also set the ``TOX_POSARGS`` environment variable to an empty string:
3131

3232
.. prompt:: bash
3333

34-
TOX_POSARGS='' tox
34+
TOX_POSARGS='' tox
3535

3636
.. note::
3737

@@ -40,20 +40,23 @@ you can also set the ``TOX_POSARGS`` environment variable to an empty string:
4040

4141
.. prompt:: bash
4242

43-
tox -- -m 'not search' -x
43+
tox -- -m 'not search' -x
4444

4545
To target a specific environment:
4646

4747
.. prompt:: bash
4848

49-
tox -e py38
49+
tox -e py38
5050

5151
The ``tox`` configuration has the following environments configured. You can
5252
target a single environment to limit the test suite:
5353

5454
py38
5555
Run our test suite using Python 3.8
5656

57+
py38-debug
58+
Same as ``py38``, but there are some useful debugging tools available in the environment.
59+
5760
lint
5861
Run code linting using `Prospector`_. This currently runs `pylint`_,
5962
`pyflakes`_, `pep8`_ and other linting tools.

readthedocs/api/v3/tests/mixins.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,10 @@ def assertDictEqual(self, d1, d2):
167167
168168
It's just a helper for debugging API responses.
169169
"""
170-
import datadiff
171-
return super().assertDictEqual(d1, d2, datadiff.diff(d1, d2))
170+
message = ''
171+
try:
172+
import datadiff
173+
message = datadiff.diff(d1, d2)
174+
except ImportError:
175+
pass
176+
return super().assertDictEqual(d1, d2, message)

requirements/debug.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Useful tools during a debug session.
2+
datadiff==2.0.0
3+
ipdb==0.13.9
4+
pdbpp==0.10.3

requirements/docker.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Requirements for our local docker development
22

33
-r pip.txt
4+
-r debug.txt
5+
46
# https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary
57
psycopg2-binary==2.9.2 # pyup: ignore
68

@@ -9,16 +11,8 @@ django-redis-cache==3.0.0
911
# For resizing images
1012
pillow==9.0.0
1113

12-
# local debugging tools
14+
# Local debugging tools
1315
watchdog==2.1.6
14-
datadiff==2.0.0
15-
ipdb==0.13.9
16-
pdbpp==0.10.3
17-
18-
# jedi 0.18 is incompatible with ipython
19-
# https://github.com/ipython/ipython/issues/12740
20-
jedi>0.17,<0.18 # pyup: ignore
21-
2216
# watchdog dependency
2317
argh==0.26.2
2418

requirements/testing.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@ Mercurial==6.0.1
1616
yamale==2.2.0 # pyup: <3.0
1717
pytest-mock==3.6.1
1818

19-
# local debugging tools
20-
datadiff==2.0.0
21-
ipdb==0.13.9
22-
2319
requests-mock==1.9.3

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ setenv =
1212
LC_ALL=en_US.UTF-8
1313
DJANGO_SETTINGS_SKIP_LOCAL=True
1414
passenv = CI TRAVIS TRAVIS_* HOME
15-
deps = -r{toxinidir}/requirements/testing.txt
15+
deps =
16+
-r{toxinidir}/requirements/testing.txt
17+
debug: -r{toxinidir}/requirements/debug.txt
1618
changedir = {toxinidir}/readthedocs
1719
basepython =
1820
python3.8

0 commit comments

Comments
 (0)