# Path: tests/utils/udev.py
# class DeviceDatabase(collections.abc.Iterable, collections.abc.Sized):
#     """
#     The udev device database.
# 
#     Takes a snapshot of the udev device database when it is initialized.
#     Consequently, some :class:`DeviceData` objects in the database may
#     not exist when the database is iterated over.
# 
#     This class is an iterable over :class:`DeviceData` objects that contain the
#     data associated with each device stored in the udev database.
#     """
# 
#     _db = None
# 
#     @classmethod
#     def db(cls, renew=False):  # pylint: disable=invalid-name
#         """
#         Get a database object.
# 
#         :param bool renew: if renew is True, get a new object
#         :returns: a database object
#         :rtype: :class:`DeviceDatabase`
#         """
#         if cls._db is None or renew:
#             udevadm = UDevAdm.adm()
#             if udevadm:
#                 cls._db = DeviceDatabase(udevadm)
#         return cls._db
# 
#     def __init__(self, udevadm):
#         self._udevadm = udevadm
#         self._devices = set(self._udevadm.query_devices())
# 
#     def __iter__(self):
#         return (
#             d for d in (DeviceData(d, self._udevadm) for d in self._devices) if d.exists
#         )
# 
#     def __len__(self):
#         return sum(1 for _ in self)
# 
#     def find_device_data(self, device_path):
#         """
#         Find device data for the device designated by ``device_path``.
# 
#         ``device_path`` is a string containing the device path.
# 
#         Return a :class:`DeviceData` object containing the data for the given
#         device, or ``None`` if the device was not found.
#         """
#         data = DeviceData(device_path, self._udevadm)
#         return data if data.exists and data in self else None


import random
import pytest
    import mock
from tests.utils.udev import DeviceDatabase
from pyudev import Devices, Monitor
    from unittest import mock
        from pyudev.glib import MonitorObserver
        from pyudev import wx
        from pyudev.wx import EVT_DEVICE_EVENT
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# isort: FUTURE
from __future__ import absolute_import, division, print_function, unicode_literals

# isort: STDLIB

# isort: THIRDPARTY

# isort: FIRSTPARTY

# isort: LOCAL

try:
    # isort: STDLIB
except ImportError:
    # isort: THIRDPARTY


@pytest.fixture
def monitor(request):
    return Monitor.from_netlink(request.getfixturevalue("context"))


@pytest.fixture
def fake_monitor_device(request):

# Path: tests/utils/udev.py
# class DeviceDatabase(collections.abc.Iterable, collections.abc.Sized):
#     """
#     The udev device database.
# 
#     Takes a snapshot of the udev device database when it is initialized.
#     Consequently, some :class:`DeviceData` objects in the database may
#     not exist when the database is iterated over.
# 
#     This class is an iterable over :class:`DeviceData` objects that contain the
#     data associated with each device stored in the udev database.
#     """
# 
#     _db = None
# 
#     @classmethod
#     def db(cls, renew=False):  # pylint: disable=invalid-name
#         """
#         Get a database object.
# 
#         :param bool renew: if renew is True, get a new object
#         :returns: a database object
#         :rtype: :class:`DeviceDatabase`
#         """
#         if cls._db is None or renew:
#             udevadm = UDevAdm.adm()
#             if udevadm:
#                 cls._db = DeviceDatabase(udevadm)
#         return cls._db
# 
#     def __init__(self, udevadm):
#         self._udevadm = udevadm
#         self._devices = set(self._udevadm.query_devices())
# 
#     def __iter__(self):
#         return (
#             d for d in (DeviceData(d, self._udevadm) for d in self._devices) if d.exists
#         )
# 
#     def __len__(self):
#         return sum(1 for _ in self)
# 
#     def find_device_data(self, device_path):
#         """
#         Find device data for the device designated by ``device_path``.
# 
#         ``device_path`` is a string containing the device path.
# 
#         Return a :class:`DeviceData` object containing the data for the given
#         device, or ``None`` if the device was not found.
#         """
#         data = DeviceData(device_path, self._udevadm)
#         return data if data.exists and data in self else None


# Path: tests/test_observer.py
import random
import pytest
    import mock
from tests.utils.udev import DeviceDatabase
from pyudev import Devices, Monitor
    from unittest import mock
        from pyudev.glib import MonitorObserver
        from pyudev import wx
        from pyudev.wx import EVT_DEVICE_EVENT

# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# isort: FUTURE
from __future__ import absolute_import, division, print_function, unicode_literals

# isort: STDLIB

# isort: THIRDPARTY

# isort: FIRSTPARTY

# isort: LOCAL

try:
    # isort: STDLIB
except ImportError:
    # isort: THIRDPARTY


@pytest.fixture
def monitor(request):
    return Monitor.from_netlink(request.getfixturevalue("context"))


@pytest.fixture
def fake_monitor_device(request):

    context = request.getfixturevalue("context")