Skip to content

Commit cbe663d

Browse files
authored
Fix typos (#289)
Found via `codespell`.
1 parent 112ca87 commit cbe663d

File tree

12 files changed

+40
-40
lines changed

12 files changed

+40
-40
lines changed

.github/workflows/base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
# Share ./docs/reports so that they can be deployed with doc in next job
7373
- name: Share reports with other jobs
74-
# if: matrix.nox_session == '...': not needed, if empty wont be shared
74+
# if: matrix.nox_session == '...': not needed, if empty won't be shared
7575
uses: actions/upload-artifact@master
7676
with:
7777
name: reports_dir

docs/api_reference.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ cases = get_all_cases(f, cases=".")
358358
import test.test_xyz
359359
xyz_cases = get_all_cases(test.test_xyz)
360360

361-
# Can be used to filter explict cases, in which case no parametrization_target is needed
361+
# Can be used to filter explicit cases, in which case no parametrization_target is needed
362362
filtered_cases = get_all_cases(cases=[case_1, case_2, case_3], has_tag=["banana"])
363363
```
364364

@@ -413,7 +413,7 @@ As a consequence it does not support the `params` and `ids` arguments anymore.
413413
- **autouse**: if True, the fixture func is activated for all tests that can see it. If False (the default) then an explicitreference is needed to activate the fixture.
414414
- **name**: the name of the fixture. This defaults to the name of the decorated function. Note: If a fixture is used in the same module in which it is defined, the function name of the fixture will be shadowed by the function arg that requests the fixture; one wayto resolve this is to name the decorated function ``fixture_<fixturename>`` and then use ``@pytest.fixture(name='<fixturename>')``.
415415
- **unpack_into**: an optional iterable of names, or string containing coma-separated names, for additional fixtures to create to represent parts of this fixture. See [`unpack_fixture`](#unpack_fixture) for details.
416-
- **hook**: an optional hook to apply to each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
416+
- **hook**: an optional hook to apply to each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
417417
- **kwargs**: other keyword arguments for `@pytest.fixture`
418418

419419
### `unpack_fixture`
@@ -468,7 +468,7 @@ class TestClass:
468468
- **argnames**: same as `@pytest.mark.parametrize` `argnames`.
469469
- **fixture**: a fixture name string or a fixture symbol. If a fixture symbol is provided, the created fixtures will have the same scope. If a name is provided, they will have scope='function'. Note that in practice the performance loss resulting from using `function` rather than a higher scope is negligible since the created fixtures' body is a one-liner.
470470
- **in_cls**: a boolean (default `False`). You may wish to turn this to `True` to use this function inside a class. If you do so, you **MUST** assign the output to variables in the class.
471-
- **hook**: an optional hook to apply to each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
471+
- **hook**: an optional hook to apply to each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
472472

473473
**Outputs:** the created fixtures.
474474

@@ -510,7 +510,7 @@ leads to very explicit ids: `<union>/<idx>/<alternative>`. See `UnionFixtureAlte
510510
- `unpack_into`: an optional iterable of names, or string containing coma-separated names, for additional fixtures to create to represent parts of this fixture. See `unpack_fixture` for details.
511511
- `ids`: as in pytest. The default value returns the correct fixture
512512
- `autouse`: as in pytest
513-
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
513+
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
514514
- `kwargs`: other pytest fixture options. They might not be supported correctly.
515515

516516
**Outputs:** the new fixture. Note: you do not need to capture that output in a symbol, since the fixture is automatically registered in your module. However if you decide to do so make sure that you use the same name.
@@ -555,7 +555,7 @@ def test_uses_param2(arg1, arg2, fixture_uses_param2):
555555
- `autouse`: see fixture `autouse`
556556
- `ids`: same as `@pytest.mark.parametrize` `ids`
557557
- `scope`: see fixture `scope`
558-
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
558+
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
559559
- `kwargs`: any other argument for the created 'fixtures'
560560

561561
### `param_fixture`
@@ -602,7 +602,7 @@ Both `fixture_ref` and `lazy_value` can be used to represent a single argvalue,
602602

603603
Finally, `pytest.param` is supported even when there are `fixture_ref` and `lazy_value`.
604604

605-
Here as for all functions above, an optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
605+
Here as for all functions above, an optional `hook` can be passed, to apply on each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
606606

607607
**Parameters**
608608

@@ -622,7 +622,7 @@ Here as for all functions above, an optional `hook` can be passed, to apply on e
622622

623623
- `scope`: The scope of the union fixture to create if `fixture_ref`s are found in the argvalues. Otherwise same as in `pytest.mark.parametrize`.
624624

625-
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called everytime a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
625+
- `hook`: an optional hook to apply to each fixture function that is created during this call. The hook function will be called every time a fixture is about to be created. It will receive a single argument (the function implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from `pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
626626

627627
- `debug`: print debug messages on stdout to analyze fixture creation (use pytest -s to see them)
628628

docs/changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ Fixed [#48](https://github.com/smarie/python-pytest-cases/issues/48).
490490

491491
### 1.9.0 - New `--with-reorder` commandline option
492492

493-
New commandline option '--with-reorder' to change the reordering startegy currently in application. Fixes [#45](https://github.com/smarie/python-pytest-cases/issues/45).
493+
New commandline option '--with-reorder' to change the reordering strategy currently in application. Fixes [#45](https://github.com/smarie/python-pytest-cases/issues/45).
494494

495495
The `--with-reorder` "skip" mode was not working correctly in presence of marks, fixed it. Fixed [#46](https://github.com/smarie/python-pytest-cases/issues/46).
496496

@@ -562,7 +562,7 @@ Following [Sup3rGeo](https://github.com/Sup3rGeo)'s proposal, introduced two hel
562562

563563
### 1.4.2 - parametrized `@pytest_fixture_plus` minor bug fix
564564

565-
`@pytest_fixture_plus` now correctly honors parameter id and marks overriden at single parameter level using `pytest.param`. Fixed [#30](https://github.com/smarie/python-pytest-cases/issues/30).
565+
`@pytest_fixture_plus` now correctly honors parameter id and marks overridden at single parameter level using `pytest.param`. Fixed [#30](https://github.com/smarie/python-pytest-cases/issues/30).
566566

567567
### 1.4.1 - parametrized `@pytest_fixture_plus` minor bug fix
568568

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ After starting to reuse cases in several test functions, you might end-up thinki
452452
453453
That being said, **if you are certain that your tests do not modify your cases data**, there are several ways to solve this issue:
454454
455-
- the easiest way is to **use fixtures with a broad scope**, as explained [above](#b-parametrizing-fixtures). However in some parametrization scenarii, `pytest` does not guarantee that the fixture will be setup only once for the whole session, even if it is a session-scoped fixture. Also the cases will be parsed everytime you run pytest, which might be cumbersome
455+
- the easiest way is to **use fixtures with a broad scope**, as explained [above](#b-parametrizing-fixtures). However in some parametrization scenarii, `pytest` does not guarantee that the fixture will be setup only once for the whole session, even if it is a session-scoped fixture. Also the cases will be parsed every time you run pytest, which might be cumbersome
456456
457457
```python
458458
from pytest_cases import parametrize, parametrize_with_cases, fixture

docs/pytest_goodies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Another consequence of using [`fixture_ref`](./api_reference.md#fixture_ref) is
272272

273273
## passing a `hook`
274274

275-
As per version `1.14`, all the above functions now support passing a `hook` argument. This argument should be a callable. It will be called everytime a fixture is about to be created by `pytest_cases` on your behalf. The fixture function is passed as the argument of the hook, and the hook should return it as the result.
275+
As per version `1.14`, all the above functions now support passing a `hook` argument. This argument should be a callable. It will be called every time a fixture is about to be created by `pytest_cases` on your behalf. The fixture function is passed as the argument of the hook, and the hook should return it as the result.
276276

277277
You can use this fixture to better understand which fixtures are created behind the scenes, and also to decorate the fixture functions before they are created. For example you can use `hook=saved_fixture` (from [`pytest-harvest`](https://smarie.github.io/python-pytest-harvest/)) in order to save the created fixtures in the fixture store.
278278

src/pytest_cases/case_parametrizer_new.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def parametrize_with_cases(argnames, # type: Union[str, List[str]
9090
`test_<name>_cases.py` or if not found, `cases_<name>.py`, where `test_<name>` is the current module name.
9191
9292
Finally, the `cases` argument also accepts an explicit case function, cases-containing class, module or module name;
93-
or a list of such elements. Note that both absolute and relative module names are suported.
93+
or a list of such elements. Note that both absolute and relative module names are supported.
9494
9595
Note that `@parametrize_with_cases` collection and parameter creation steps are strictly equivalent to
9696
`get_all_cases` + `get_parametrize_args`. This can be handy for debugging purposes.
@@ -469,7 +469,7 @@ def case_to_argvalues(host_class_or_module, # type: Union[Type, ModuleType]
469469
if debug:
470470
case_fun_str = qname(case_fun.func if isinstance(case_fun, functools.partial) else case_fun)
471471
print("Case function %s > fixture_ref(%r) with marks %s" % (case_fun_str, fix_name, remaining_marks))
472-
# return a lengh-1 tuple because there is a single case created
472+
# return a length-1 tuple because there is a single case created
473473
return (make_marked_parameter_value((argvalues,), marks=remaining_marks) if remaining_marks else argvalues,)
474474

475475

@@ -963,7 +963,7 @@ def get_current_params(request_or_item):
963963
raise ValueError("Error: multiple values found for the same fixture parameter. Please report this issue")
964964
fixture_results_dict[fixture_name] = fixture_results_dct
965965

966-
# the remainder: fixtures that cant be found.
966+
# the remainder: fixtures that can't be found.
967967
results_unknown_dict = dict()
968968
for function, results_list in results_known_fixtures_but_not_found.items():
969969
fixture_results_dct = dict(results_list)

src/pytest_cases/common_pytest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def make_test_ids_from_param_values(param_names,
364364
paramids = []
365365
for _idx, vv in enumerate(param_values):
366366
if len(vv) != nb_params:
367-
raise ValueError("Inconsistent lenghts for parameter names and values: '%s' and '%s'"
367+
raise ValueError("Inconsistent lengths for parameter names and values: '%s' and '%s'"
368368
"" % (param_names, vv))
369369
_id = mini_idvalset(param_names, vv, _idx)
370370
paramids.append(_id)

src/pytest_cases/fixture_core1_unions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def fixture_union(name, # type: str
286286
fixtures to create to represent parts of this fixture. See `unpack_fixture` for details.
287287
:param autouse: as in pytest
288288
:param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
289-
will be called everytime a fixture is about to be created. It will receive a single argument (the function
289+
will be called every time a fixture is about to be created. It will receive a single argument (the function
290290
implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
291291
`pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
292292
:param kwargs: other pytest fixture options. They might not be supported correctly.
@@ -364,7 +364,7 @@ def _fixture_union(fixtures_dest,
364364
:param unpack_into:
365365
:param autouse:
366366
:param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
367-
will be called everytime a fixture is about to be created. It will receive a single argument (the function
367+
will be called every time a fixture is about to be created. It will receive a single argument (the function
368368
implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
369369
`pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
370370
:param caller: a function to reference for error messages
@@ -468,7 +468,7 @@ def test_function(self, a, b):
468468
:param in_cls: a boolean (default False). You may wish to turn this to `True` to use this function inside a class.
469469
If you do so, you **MUST** assign the output to variables in the class.
470470
:param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
471-
will be called everytime a fixture is about to be created. It will receive a single argument (the function
471+
will be called every time a fixture is about to be created. It will receive a single argument (the function
472472
implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
473473
`pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
474474
:return: the created fixtures.
@@ -490,12 +490,12 @@ def _unpack_fixture(fixtures_dest, # type: ModuleType
490490
):
491491
"""
492492
493-
:param fixtures_dest: if this is `None` the fixtures wont be registered anywhere (just returned)
493+
:param fixtures_dest: if this is `None` the fixtures won't be registered anywhere (just returned)
494494
:param argnames:
495495
:param fixture:
496496
:param in_cls: a boolean indicating if the `self` argument should be prepended.
497497
:param hook: an optional hook to apply to each fixture function that is created during this call. The hook function
498-
will be called everytime a fixture is about to be created. It will receive a single argument (the function
498+
will be called every time a fixture is about to be created. It will receive a single argument (the function
499499
implementing the fixture) and should return the function to use. For example you can use `saved_fixture` from
500500
`pytest-harvest` as a hook in order to save all such created fixtures in the fixture store.
501501
:return:

0 commit comments

Comments
 (0)