| 1 |
# This file is part of Hypothesis, which may be found at |
| 2 |
# https://github.com/HypothesisWorks/hypothesis/ |
| 3 |
# |
| 4 |
# Copyright the Hypothesis Authors. |
| 5 |
# Individual contributors are listed in AUTHORS.rst and the git log. |
| 6 |
# |
| 7 |
# This Source Code Form is subject to the terms of the Mozilla Public License, |
| 8 |
# v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 9 |
# obtain one at https://mozilla.org/MPL/2.0/. |
| 10 |
|
| 11 |
from hypothesis.database import ( |
| 12 |
DirectoryBasedExampleDatabase, |
| 13 |
InMemoryExampleDatabase, |
| 14 |
MultiplexedDatabase, |
| 15 |
) |
| 16 |
|
| 17 |
from tests.common.utils import skipif_threading |
| 18 |
|
| 19 |
# trivial covering tests as a stopgap while we skip our proper database listener |
| 20 |
# tests. Can be removed when we re-enable those. |
| 21 |
|
| 22 |
|
| 23 |
@skipif_threading |
| 24 |
def test_start_stop_multiplexed_listener(tmp_path): |
| 25 |
db = MultiplexedDatabase( |
| 26 |
InMemoryExampleDatabase(), DirectoryBasedExampleDatabase(tmp_path) |
| 27 |
) |
| 28 |
listener = lambda event: None |
| 29 |
db.add_listener(listener) |
| 30 |
db.remove_listener(listener) |
| 31 |
|
| 32 |
|
| 33 |
@skipif_threading |
| 34 |
def test_start_stop_directory_listener(tmp_path): |
| 35 |
db = DirectoryBasedExampleDatabase(tmp_path) |
| 36 |
listener = lambda event: None |
| 37 |
db.add_listener(listener) |
| 38 |
db.remove_listener(listener) |