fixtures.pytest_store module¶
Storage for pytest objects during test runs
The objects in the module will change during the course of a test run, so they have been stashed into the ‘store’ namespace
Usage:
# as pytest.store
import pytest
pytest.store.config, pytest.store.pluginmanager, pytest.store.session
# imported directly (store is pytest.store)
from fixtures.pytest_store import store
store.config, store.pluginmanager, store.session
The availability of these objects varies during a test run, but all should be available in the collection and testing phases of a test run.
-
class
fixtures.pytest_store.
FlexibleTerminalReporter
(config=None, file=None)[source]¶ Bases:
_pytest.terminal.TerminalReporter
A TerminalReporter stand-in that pretends to work even without a py.test config.
-
class
fixtures.pytest_store.
Store
[source]¶ Bases:
object
pytest object store
If a property isn’t available for any reason (including being accessed outside of a pytest run), it will be None.
-
base_url
¶ If there is a current appliance the base url of that appliance is returned else, the base_url from the config is returned.
-
capturemanager
¶
-
config
= None¶ The py.test config instance, None if not in py.test
-
current_appliance
¶
-
fixturemanager
¶
-
has_config
¶
-
in_pytest_session
¶
-
my_ip_address
¶
-
parallel_session
¶
-
parallelizer_role
= None¶ Parallelizer role, None if not running a parallelized session
-
pluginmanager
¶
-
session
= None¶ The current py.test session, None if not in a py.test session
-
slave_manager
¶
-
slaveid
¶
-
ssh_clients_to_close
= None¶ hack variable until we get a more sustainable solution
-
terminaldistreporter
¶
-
terminalreporter
¶
-
-
fixtures.pytest_store.
write_line
(line, **kwargs)[source]¶ A write-line helper that should always write a line to the terminal
It knows all of py.tests dirty tricks, including ones that we made, and works around them.
Parameters: **kwargs – Normal kwargs for pytest line formatting, stripped from slave messages