2022-08-14 22:01:28 +02:00
|
|
|
"""
|
2022-08-25 13:46:19 +02:00
|
|
|
This module contains the main plugin class. By the time of writing, it is quite unspectacular.
|
2022-08-14 22:01:28 +02:00
|
|
|
"""
|
|
|
|
|
2022-08-15 19:32:09 +02:00
|
|
|
from _pytest.config import Config
|
2022-08-14 22:01:28 +02:00
|
|
|
|
2022-08-25 13:46:19 +02:00
|
|
|
BASE_DIR_KEY = "__pytest_csv_params__config__base_dir"
|
|
|
|
"""
|
|
|
|
The class attribute key for :class:`Plugin` to store the base dir command line argument value.
|
|
|
|
"""
|
2022-08-15 14:25:39 +02:00
|
|
|
|
|
|
|
|
2022-08-14 22:01:28 +02:00
|
|
|
class Plugin: # pylint: disable=too-few-public-methods
|
|
|
|
"""
|
2022-08-25 13:46:19 +02:00
|
|
|
The main plugin class
|
|
|
|
|
|
|
|
Currently, this class is nothing more than the keeper of the value of the command line argument (as defined by
|
|
|
|
:meth:`_ptcsvp.cmdline.pytest_addoption`.
|
2022-08-14 22:01:28 +02:00
|
|
|
"""
|
|
|
|
|
2022-08-15 19:32:09 +02:00
|
|
|
def __init__(self, config: Config) -> None:
|
2022-08-14 22:01:28 +02:00
|
|
|
"""
|
2022-08-25 13:46:19 +02:00
|
|
|
Initialize the class, and simply store the value of the command line argument, as class attribute.
|
|
|
|
|
|
|
|
:param config: Pytest configuration
|
2022-08-14 22:01:28 +02:00
|
|
|
"""
|
2022-08-15 14:25:39 +02:00
|
|
|
setattr(Plugin, BASE_DIR_KEY, config.option.csv_params_base_dir)
|