Skip to content

Commit 2ba9717

Browse files
committed
fix documentation
1 parent b0bbea7 commit 2ba9717

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

coveo-ref/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tool that can extract the string representation of a python objet. This is what
1919

2020
```python
2121
from unittest.mock import patch, MagicMock
22-
from coveo_testing.mocks import ref
22+
from coveo_ref import ref
2323
from mymodule.clients import APIClient
2424

2525
@patch(*ref(APIClient._do_request))
@@ -64,7 +64,7 @@ But with `ref`, you specify the context separately:
6464

6565
```python
6666
from unittest.mock import patch, MagicMock
67-
from coveo_testing.mocks import ref
67+
from coveo_ref import ref
6868
from mymodule.clients import get_api_client
6969
from mymodule.tasks import process
7070

@@ -100,7 +100,7 @@ The test:
100100

101101
```python
102102
from unittest.mock import patch, MagicMock
103-
from coveo_testing.mocks import ref
103+
from coveo_ref import ref
104104
from mymodule.clients import get_api_client
105105
from mymodule.tasks import process
106106

@@ -132,7 +132,7 @@ can unpack to `patch.object()`:
132132

133133
```python
134134
from unittest.mock import patch
135-
from coveo_testing.mocks import ref
135+
from coveo_ref import ref
136136
from mymodule.clients import APIClient
137137

138138
def test() -> None:
@@ -155,7 +155,7 @@ For instance, consider this test:
155155
```python
156156
from http.client import HTTPResponse
157157
from unittest.mock import patch, MagicMock
158-
from coveo_testing.mocks import ref
158+
from coveo_ref import ref
159159

160160
from mymodule.tasks import process
161161

@@ -226,7 +226,7 @@ So you _know_ this works globally, because no one will (should?) import the priv
226226

227227
```python
228228
from unittest.mock import patch, MagicMock
229-
from coveo_testing.mocks import ref
229+
from coveo_ref import ref
230230

231231
from mymodule.tasks import process
232232
from mymodule.clients import _get_api_client
@@ -259,7 +259,7 @@ The test, showing 3 different methods that work:
259259

260260
```python
261261
from unittest.mock import patch, MagicMock
262-
from coveo_testing.mocks import ref
262+
from coveo_ref import ref
263263

264264
from mymodule.clients import get_api_client
265265
from mymodule.tasks import process
@@ -296,7 +296,7 @@ Sometimes, the test file _is_ the context. When that happens, just pass `__name_
296296

297297
```python
298298
from unittest.mock import patch
299-
from coveo_testing.mocks import ref
299+
from coveo_ref import ref
300300
from mymodule.clients import get_api_client, APIClient
301301

302302
def _prepare_test() -> APIClient:
@@ -377,7 +377,7 @@ class MyClass:
377377

378378
```python
379379
from unittest.mock import PropertyMock, patch, MagicMock
380-
from coveo_testing.mocks import ref
380+
from coveo_ref import ref
381381

382382
from mymodule import MyClass
383383

@@ -406,7 +406,7 @@ For this particular scenario, the workaround is to provide the instance as the c
406406

407407
```python
408408
from unittest.mock import patch
409-
from coveo_testing.mocks import ref
409+
from coveo_ref import ref
410410

411411

412412
class MyClass:

coveo-ref/coveo_ref/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def ref(
329329
refactorable mocks.
330330
331331
The idea is to provide the thing to mock as the target, and sometimes, the thing that is being tested
332-
as the context. Refer to `coveo-testing`'s readme to better understand when a context is necessary.
332+
as the context. Refer to `coveo-ref`'s readme to better understand when a context is necessary.
333333
334334
For example, pass the `HTTPResponse` class as the target and the `my_module.function_to_test` function
335335
as the context, so that `my_module.HTTPResponse` becomes mocked (and not httplib.client.HTTPResponse).
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
11
"""pytest bootstrap"""
2-
3-
from _pytest.config import Config
4-
from coveo_testing.markers import register_markers
5-
6-
7-
def pytest_configure(config: Config) -> None:
8-
"""This pytest hook is ran once, before collecting tests."""
9-
register_markers(config)

0 commit comments

Comments
 (0)