Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fritz component test relies on missing mocker fixture #50253

Closed
mweinelt opened this issue May 7, 2021 · 1 comment · Fixed by #50400
Closed

fritz component test relies on missing mocker fixture #50253

mweinelt opened this issue May 7, 2021 · 1 comment · Fixed by #50400

Comments

@mweinelt
Copy link
Contributor

mweinelt commented May 7, 2021

The problem

The fritz config flow test has the following fixture, that relies upon the mocker fixture, which does not exist. It works when installing pytest-mock, but that package is not in the requirements.

@pytest.fixture()
def fc_class_mock(mocker):
"""Fixture that sets up a mocked FritzConnection class."""

Where is this fixture supposed to come from?

What is version of Home Assistant Core has the issue?

2021.5.0

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant Core

Integration causing the issue

fritz

Link to integration documentation on our website

https://www.home-assistant.io/integrations/fritz

Example YAML snippet

No response

Anything in the logs that might be useful for us?

@pytest.fixture()
  def fc_class_mock(mocker):
E       fixture 'mocker' not found
>       available fixtures: aioclient_mock, aiohttp_client, aiohttp_raw_server, aiohttp_server, aiohttp_unused_port, bcrypt_cost, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, current_request, current_request_with_host, doctest_namespace, enable_custom_integrations, fail_on_log_exception, fast, fc_class_mock, hass, hass_access_token, hass_admin_credential, hass_admin_user, hass_client, hass_owner_user, hass_read_only_access_token, hass_read_only_user, hass_storage, hass_ws_client, legacy_auth, legacy_patchable_time, load_registries, local_auth, loop, loop_debug, mock_device_tracker_conf, mock_zeroconf, monkeypatch, mqtt_client_mock, mqtt_config, mqtt_mock, patch_zeroconf_multiple_catcher, prevent_io, proactor_loop, pytestconfig, raw_test_server, record_property, record_testsuite_property, record_xml_attribute, recwarn, requests_mock, stop_hass, test_client, test_server, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unused_port, verify_cleanup, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

Additional information

No response

@probot-home-assistant
Copy link

fritz documentation
fritz source
(message by IssueLinks)

@mweinelt mweinelt changed the title fritz component test relies on mocker fixture fritz component test relies on missing mocker fixture May 7, 2021
mweinelt added a commit to dotlambda/nixpkgs that referenced this issue May 7, 2021
These tests require pytest-mock for the mocker fixture, but it isn't
declared anywhere.

home-assistant/core#50253
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant