semvec/pypi-packages huggingface dataset:
fixtopt-xtofl 0.1.4
Pytest extension for adding test options
License: MIT
Requires Python: >=3.8,<4.0

# fixtopt

Extend your pytests with options that can be accessed as test fixtures.

Pytest allows declaring command line options for your tests.  You
specify this in a [test hook](https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_addoption)
defined in e.g. a file called [`conftest.py`](https://docs.pytest.org/en/latest/writing_plugins.html#conftest-py-local-per-directory-plugins),
inside your test directory.

Add the options:

```python
# conftest.py
from fixtopt import Option, register

def pytest_addoption(parser):
    register(globals(), parser, (

        Option(
            name="message",
            default="message.txt",
            help="the message file"),

        Option(
            name="receiver",
            default="World",
            help="the receiver"),

    ))
```

Import the options in your tests like you would import a fixture:

```python
import my_mailclient

def test_a_person_receives_a_message(message, receiver):
    with open(message) as f:
        assert my_mailclient.receiver(f.read()) == receiver
```

And you can run your tests with the declared options:

```shell
pytest . --message /path/to/messagefile --receiver mrs.X
```
AshEvent-Za08 0.3
A simple event system in Python
License: MIT

# AshEvent 0.3

## Introduction
AshEvent implemented a very simple ``event system`` in Python.  
It works like this:  

You use ``@EventHandler`` to let the below function subscribe to a type of event.  
Suppose you defined a EventA class that inherits the ``Event`` class we provide.  
Also, EventA has a custom variable **msg**.  
You can write something like this:

```python
@EventHandler(EventA)
def onAHappened(event):
    print(event.message)
```
Now whenever you instantiate EventA and use the call method: ```EventA('some string...').call()```,  
AshEvent will notice it and call the function ``onAHappened`` we just defined.  

This is how AshEvent basically works.  
Furthermore, You can use ``Priority`` to set the order for the functions to run.  
You can use ``unsubscribe`` function to make a function no longer subscribe to a type of event.  
And you can use ``type``, ``cancelled`` in an event to create different effects.  
Know more about AshEvent in [examples](https://github.com/The-Ash-Team/AshEvent/main/examples)...