File: function_getter.py

package info (click to toggle)
python-pytest-resource-path 1.3.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: python: 398; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 559 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Implements getting process for function object in pytest by pytest file name and testdir object."""
from tests.testlibraries.module_getter import ModuleGetter


class FunctionGetter:
    """Implements getting process for function object in pytest by pytest file name and testdir object."""

    @staticmethod
    def get(file_name_pytest: str, testdir_structure):
        """Gets function object."""
        modulecol = ModuleGetter.get(file_name_pytest, testdir_structure)
        (item,) = testdir_structure.genitems([modulecol])
        return item.obj