Skip to content

Commit

Permalink
Fix plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpasternak committed Aug 7, 2022
1 parent ef03a8f commit 47bc3e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pytest-black
pytest-localserver
selenium
splinter>=0.9.0
pytest-xdist
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ def simple_page_content():
<textarea id="textarea">area text</textarea>
</body>
</html>"""


@pytest.fixture
def simple_page(httpserver, browser, simple_page_content):
"""Serve simple html page."""
httpserver.serve_content(
simple_page_content, code=200, headers={"Content-Type": "text/html"}
)
browser.visit(httpserver.url)


9 changes: 0 additions & 9 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
from pytest_splinter.plugin import get_args


@pytest.fixture
def simple_page(httpserver, browser, simple_page_content):
"""Serve simple html page."""
httpserver.serve_content(
simple_page_content, code=200, headers={"Content-Type": "text/html"}
)
browser.visit(httpserver.url)


def test_browser(browser):
"""Check the browser fixture."""
assert isinstance(browser, DriverAPI)
Expand Down

0 comments on commit 47bc3e6

Please sign in to comment.