Skip to content

Commit 0e2097d

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
Update README to clarify fixture usage and fix examples
1 parent 5b926ab commit 0e2097d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Sometimes you have code that needs to work the same way with regular, asynchrono
2323

2424
## Usage
2525

26-
To use the fixture, you need to add it to your project using the following command:
26+
To use the fixture, install it via:
2727

2828
```bash
2929
pip install transtests
3030
```
3131

32-
The `transformed` fixture is now available for use. It returns a decorator that transforms the original function into one of three variants: the function itself, the same function but as an async, or as a generator function:
32+
The `transformed` fixture is now available. It returns a decorator that transforms the original function into one of three variants: the original synchronous function, the same function but as an async one, or as a generator function:
3333

3434
```python
3535
from asyncio import run
@@ -41,13 +41,13 @@ def test_something(transformed):
4141
return a + b
4242

4343
if iscoroutinefunction(function):
44-
assert run(function(1, 2)) == 3
44+
assert run(some_function(1, 2)) == 3
4545

4646
elif isgeneratorfunction(function):
47-
assert list(function(1, 2)) == [3]
47+
assert list(some_function(1, 2)) == [3]
4848

4949
else:
50-
assert function(1, 2) == 3
50+
assert some_function(1, 2) == 3
5151
```
5252

53-
This functionality is based on the [`transfunctions`](https://github.com/mutating/transfunctions) library, so you can use context managers from that library in the original template function.
53+
This functionality is based on the [`transfunctions`](https://github.com/mutating/transfunctions) library, so you can use context managers from that library in the source function.

0 commit comments

Comments
 (0)