File: hookspec.py

package info (click to toggle)
pytest-tempdir 2019.10.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 108 kB
  • sloc: python: 213; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
'''
    :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
    :copyright: © 2019 by the SaltStack Team, see AUTHORS for more details.
    :license: Apache 2.0, see LICENSE for more details.


    pytest_tempdir.hookspec
    ~~~~~~~~~~~~~~~~~~~~~~~

    Hookspec definition
'''

import pytest


@pytest.hookspec(firstresult=True)
def pytest_tempdir_temproot():
    '''
    An alternate way to define the temporary directory root.
    '''

@pytest.hookspec(firstresult=True)
def pytest_tempdir_basename():
    '''
    An alternate way to define the predictable temporary directory.
    By default returns ``None`` and get's the basename either from the INI file or
    from the CLI passed option
    '''