You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To tailor your doctesting experience, you can utilize an instance of `DTConfig`.
169
-
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/ev-br/scpdt#tailoring-your-doctesting-experience) section.
170
-
171
-
3.**Run Doctests**
172
-
173
-
Doctesting is configured to execute on SciPy using the `dev.py` module.
174
-
175
-
To run all doctests, use the following command:
176
-
```bash
177
-
python dev.py test --doctests
178
-
```
179
-
180
-
To run doctests on specific SciPy modules, e.g: `cluster`, use the following command:
181
-
182
-
```bash
183
-
python dev.py test --doctests -s cluster
184
-
```
185
-
186
-
### Running Doctests on Other Packages/Projects
157
+
### Running Doctests on Packages/Projects
187
158
188
159
If you want to run doctests on packages or projects other than SciPy, follow these steps:
@@ -202,14 +173,14 @@ To do this, add the following line of code:
202
173
```python
203
174
# In your conftest.py file or test module
204
175
205
-
pytest_plugins ="scpdt"
176
+
pytest_plugins ="scipy_doctest"
206
177
```
207
178
208
179
Check out the [pytest documentation](https://docs.pytest.org/en/stable/how-to/writing_plugins.html#requiring-loading-plugins-in-a-test-module-or-conftest-file) for more information on requiring/loading plugins in a test module or `conftest.py` file.
209
180
210
181
3.**Configure your doctesting experience**
211
182
212
-
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/ev-br/scpdt#tailoring-your-doctesting-experience) section.
183
+
An in-depth explanation is given in the [tailoring your doctesting experience](https://github.com/scipy/scipy_doctest#tailoring-your-doctesting-experience) section.
[DTConfig](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/impl.py#L16) offers a variety of attributes that allow you to fine-tune your doctesting experience.
206
+
[DTConfig](https://github.com/scipy/scipy_doctest/blob/main/scipy_doctest/impl.py#L23) offers a variety of attributes that allow you to fine-tune your doctesting experience.
236
207
237
208
These attributes include:
238
209
1.**default_namespace (dict):** Defines the namespace in which examples are executed.
@@ -252,16 +223,16 @@ Typically, it is entered for each DocTest (especially in API documentation), ens
252
223
12.**nameerror_after_exception (bool):** Controls whether subsequent examples in the same test, after one has failed, may raise spurious NameErrors. Set to `True` if you want to observe these errors or if your test is expected to raise NameErrors. The default is `False`.
253
224
254
225
To set any of these attributes, create an instance of `DTConfig` called `dt_config`.
255
-
This instance is already set as an [attribute of pytest's `Config` object](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/plugin.py#L27).
226
+
This instance is already set as an [attribute of pytest's `Config` object](https://github.com/scipy/scipy_doctest/blob/58ff06a837b7bff1dbac6560013fc6fd07952ae2/scipy_doctest/plugin.py#L39).
If you don't set these attributes, the [default settings](https://github.com/ev-br/scpdt/blob/671083d65b54111770cee71c9bc790ac652d59ab/scpdt/impl.py#L73) of the attributes are used.
244
+
If you don't set these attributes, the [default settings](https://github.com/scipy/scipy_doctest/blob/58ff06a837b7bff1dbac6560013fc6fd07952ae2/scipy_doctest/impl.py#L94) of the attributes are used.
274
245
275
246
By following these steps, you will be able to effectively use the Scpdt pytest plugin for doctests in your Python projects.
276
247
@@ -299,7 +270,7 @@ instead of `$ pytest --pyargs scipy`.
299
270
If push comes to shove, you may try using the magic env variable:
300
271
` PY_IGNORE_IMPORTMISMATCH=1 pytest ...`,
301
272
however the need usually indicates an issue with the package itself.
302
-
(see [gh-107](https://github.com/ev-br/scpdt/pull/107) for an example).
273
+
(see [gh-107](https://github.com/scipy/scipy_doctest/pull/107) for an example).
0 commit comments