Skip to content

Commit

Permalink
exclude custom poller form test from nb 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
amyasnikov committed Nov 16, 2024
1 parent 8a93eb7 commit f2bccc8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mkdocs==1.6.1
mkdocs-include-markdown-plugin==4.0.4
mkdocs-include-markdown-plugin==7.0.0
mkdocs-material==9.5.34
8 changes: 4 additions & 4 deletions validity/tests/test_custom_pollers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest
from factories import CommandFactory, PollerFactory

from validity import config
from validity.dependencies import validity_settings
from validity.forms import PollerForm
from validity.models.polling import Command
Expand All @@ -25,10 +26,8 @@ def custom_poller(db, di):
settings = ValiditySettings(
custom_pollers=[PollerInfo(klass=MyCustomPoller, name="cupo", color="red", command_types=["custom"])]
)
override = di.override({validity_settings: lambda: settings})
override.__enter__()
yield PollerFactory(connection_type="cupo")
override.__exit__(None, None, None)
with di.override({validity_settings: lambda: settings}):
yield PollerFactory(connection_type="cupo")


def test_custom_poller_model(custom_poller, di):
Expand All @@ -46,6 +45,7 @@ def test_custom_poller_api(custom_poller, admin_client):
assert resp.json()["connection_type"] == "cupo"


@pytest.mark.skipif(condition=config.version < "4", reason="netbox < 4.0")
def test_custom_poller_form(custom_poller):
form = PollerForm()
form_choices = {choice[0] for choice in form["connection_type"].field.choices}
Expand Down

0 comments on commit f2bccc8

Please sign in to comment.