-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a0c353d
Showing
3 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Comparison of pytest plugins for accessing data files | ||
|
||
It is said there are more pytest plugins that aim to provide convenient access | ||
to packaged data files than grains of sand on Earth. Here I compare them all. | ||
|
||
## Comparison | ||
|
||
<table> | ||
<th> | ||
<td>Name / URL</td> | ||
<td>Supports copying to temp dir</td> | ||
<td>Supports accessing without copying</td> | ||
<td>Paths provided as</td> | ||
<td>Fixture names</td> | ||
<td>Folder names</td> | ||
</th> | ||
<tr> | ||
<td> | ||
<a href="https://pypi.org/project/pytest-datadir/">pytest-datadir</a> | ||
</td> | ||
<td> | ||
True | ||
</td> | ||
<td> | ||
False | ||
</td> | ||
<td> | ||
pathlib.Path | ||
</td> | ||
<td> | ||
`datadir`, `shared_datadir` | ||
</td> | ||
<td> | ||
`data`, `test_TEST_NAME` | ||
</td> | ||
<tr> | ||
<td> | ||
<a href="https://pypi.org/project/pytest-datadir-ng/">pytest-datadir-ng</a> | ||
</td> | ||
<td> | ||
True | ||
</td> | ||
<td> | ||
True | ||
</td> | ||
<td> | ||
py.path | ||
</td> | ||
<td> | ||
`datadir`, `datadir_copy` | ||
</td> | ||
<td> | ||
`data`, `data/test_TEST_NAME`, `test_TEST_NAME` | ||
</td> | ||
<tr> | ||
<td> | ||
<a href="https://pypi.org/project/pytest-datafixtures/">pytest-datafixtures</a> | ||
</td> | ||
<td> | ||
False | ||
</td> | ||
<td> | ||
True | ||
</td> | ||
<td> | ||
pathlib.Path | ||
</td> | ||
<td> | ||
`datafix`, `datafix_dir`, `datafix_read`, `datafix_readbin` | ||
</td> | ||
<td> | ||
`datafixtures`, `**/datafixtures` | ||
</td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Comparison of pytest plugins for accessing data files | ||
|
||
It is said there are more pytest plugins that aim to provide convenient access | ||
to packaged data files than grains of sand on Earth. Here I compare them all. | ||
|
||
## Comparison | ||
|
||
<table> | ||
<th> | ||
<td>Name / URL</td> | ||
<td>Supports copying to temp dir</td> | ||
<td>Supports accessing without copying</td> | ||
<td>Paths provided as</td> | ||
<td>Fixture names</td> | ||
<td>Folder names</td> | ||
</th> | ||
{%- for plugin in plugins %} | ||
<tr> | ||
<td> | ||
<a href="{{ plugin.pypi_url }}">{{ plugin.name }}</a> | ||
</td> | ||
<td> | ||
{{ plugin.supports_copying_to_temp }} | ||
</td> | ||
<td> | ||
{{ plugin.supports_access_without_copying }} | ||
</td> | ||
<td> | ||
{{ plugin.provided_as }} | ||
</td> | ||
<td> | ||
{{ plugin.fixture_names|map('tojson')|join(', ')|replace('"', '`') }} | ||
</td> | ||
<td> | ||
{{ plugin.folder_names|map('tojson')|join(', ')|replace('"', '`') }} | ||
</td> | ||
{%- endfor %} | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
# $ pip list | grep -iE '(jinja|pyyaml)' | ||
# Jinja2 3.0.1 | ||
# PyYAML 5.3.1 | ||
from jinja2 import Template | ||
from pathlib import Path | ||
import yaml | ||
|
||
t = Template(Path("README.template.md").read_text()) | ||
with Path("data.yml").open() as f: | ||
d = yaml.load(f, Loader=yaml.SafeLoader) | ||
s = t.render(d) | ||
Path("README.md").write_text(s) |