# Setup
in conftest.py
```python
pytest_plugins = ["parametrize_from_file.generate_tests"]
```
# Usage
## Code
from parametrize_from_file import params_from_yml
```python
@params_from_yml
def test_first(string):
assert len(string) > 0
@params_from_yml
def test_second(numer_1, number_2):
assert number_1 > number_2
```
## Data Files
test_data/test_first.yml
```yml
tc_not_zero_1:
string: some text
tc_not_zero_2:
string: another text
tc_not_zero_3:
string: still text
```
test_data/test_second.yml
```yml
tc_compare_1:
number_1: 4
number_2: 5
tc_compare_2:
number_1: 7
number_2: 5
```
Raw data
{
"_id": null,
"home_page": "",
"name": "params-from-file",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,testing,pytest,parametized",
"author": "Roland Lukacsi",
"author_email": "<lukacsiroland01@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/70/6d/e7bc9f74dc89ab0ca1ab816326eaacd0512a0319b989ba3ec8a688259ba7/params-from-file-0.0.2.tar.gz",
"platform": null,
"description": "# Setup\nin conftest.py\n```python\npytest_plugins = [\"parametrize_from_file.generate_tests\"]\n```\n\n# Usage\n\n## Code\nfrom parametrize_from_file import params_from_yml\n\n```python\n@params_from_yml\ndef test_first(string):\n assert len(string) > 0\n\n@params_from_yml\ndef test_second(numer_1, number_2):\n assert number_1 > number_2\n```\n\n## Data Files\ntest_data/test_first.yml\n```yml\ntc_not_zero_1:\n string: some text\ntc_not_zero_2:\n string: another text\ntc_not_zero_3:\n string: still text\n```\n\ntest_data/test_second.yml\n```yml\ntc_compare_1:\n number_1: 4\n number_2: 5\ntc_compare_2:\n number_1: 7\n number_2: 5\n```\n",
"bugtrack_url": null,
"license": "GNU",
"summary": "Provide data to parameterizezd tests from files",
"version": "0.0.2",
"project_urls": null,
"split_keywords": [
"python",
"testing",
"pytest",
"parametized"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bce4c18844c5b421d26342b23b5f8b4a1d795c4de3b9b4b5cc87428f926afd00",
"md5": "c9f6e769358012759e48e513b9674808",
"sha256": "22407733d7d2ff03c15c2a6dde2440b1afadd56866e6db02ba68f2dd15563816"
},
"downloads": -1,
"filename": "params_from_file-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9f6e769358012759e48e513b9674808",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14660,
"upload_time": "2024-03-17T12:43:50",
"upload_time_iso_8601": "2024-03-17T12:43:50.954201Z",
"url": "https://files.pythonhosted.org/packages/bc/e4/c18844c5b421d26342b23b5f8b4a1d795c4de3b9b4b5cc87428f926afd00/params_from_file-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "706de7bc9f74dc89ab0ca1ab816326eaacd0512a0319b989ba3ec8a688259ba7",
"md5": "11a6b4b10487de5bd572000d64b1b1cb",
"sha256": "8e56ac3fb1a30547c2aca686291718fb497e30c409142172688deae2f3e5c43f"
},
"downloads": -1,
"filename": "params-from-file-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "11a6b4b10487de5bd572000d64b1b1cb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14718,
"upload_time": "2024-03-17T12:43:54",
"upload_time_iso_8601": "2024-03-17T12:43:54.533229Z",
"url": "https://files.pythonhosted.org/packages/70/6d/e7bc9f74dc89ab0ca1ab816326eaacd0512a0319b989ba3ec8a688259ba7/params-from-file-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-17 12:43:54",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "params-from-file"
}