Provide basic builtin fixtures
See original GitHub issueCurrently ward contains no built-in fixtures. There’s a few ones that would be nice, if were provided, like pytest tmp_path
:
tmp_path
Return a temporary directory path object which is unique to each test
function invocation, created as a sub directory of the base temporary
directory.
By default, a new base temporary directory is created each test session,
and old bases are removed after 3 sessions, to aid in debugging. If
``--basetemp`` is used then it is cleared each session. See :ref:`base
temporary directory`.
The returned object is a :class:`pathlib.Path` object.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pytest fixtures: explicit, modular, scalable
Software test fixtures initialize test functions. They provide a fixed baseline so that tests execute reliably and produce consistent, repeatable, results.
Read more >An overview of built-in fixtures | pytest Quick Start Guide
Let's take a look at some built-in pytest fixtures. ... The tmpdir fixture provides an empty directory that is removed automatically at the...
Read more >Pytest API and builtin fixtures
For information on the pytest.mark mechanism, see Marking test functions with attributes. For information about fixtures, see pytest fixtures: explicit, modular ...
Read more >End-To-End Tutorial For Pytest Fixtures With Examples
For a simple test, this small overhead might not make such a huge difference in the execution. However, if the Selenium test automation ......
Read more >Python Friday #47: (Built-in) Fixtures in Pytest
Fixtures are a powerful feature in pytest. You can write your own fixtures as a replacement for setup and teardown methods or use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Mentioned elsewhere that an equivalent of
capsys
would also be useful.I just want to note that for the case of tmp_path, I happily include
plumbum
in my testing dependencies, giving me access to these fine context managers:I always prefer their path objects anyway.