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

Ruff enable fbt #47

Merged
merged 10 commits into from
Feb 14, 2024
80 changes: 80 additions & 0 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
============
Deprecations
============

This page documents
the major deprecations
in ScreenPy Selenium's life,
and how to adjust your tests
to keep them up to date.

4.1.0 Deprecations
==================

Boolean Positional Arguments Deprecation
----------------------------------------

The following class constructors
have been marked deprecated
when using a positional boolean argument in the constructor.
Starting with version 5.0.0
you will be required to provide keywords
for the following boolean arguments.

bandophahita marked this conversation as resolved.
Show resolved Hide resolved
:class:`~screenpy_selenium.actions.enter.Enter`

Before::

the_actor.will(Enter("foo", True).into_the(PASSWORD))

After::

the_actor.will(Enter("foo", mask=True).into_the(PASSWORD))


:class:`~screenpy_selenium.actions.hold_down.HoldDown`

Before::

the_actor.will(Chain(HoldDown(None, True))

After::

the_actor.will(Chain(HoldDown(None, lmb=True))
the_actor.will(Chain(HoldDown(lmb=True))


:class:`~screenpy_selenium.actions.release.Release`

Before::

the_actor.will(Release(None, True))

After::

the_actor.will(Release(None, lmb=True))
the_actor.will(Release(lmb=True))


:class:`~screenpy_selenium.questions.selected.Selected`

Before::

the_actor.shall(See.the(Selected(TARGET, True), IsEmpty()))

After::

the_actor.shall(See.the(Selected(TARGET, multi=True), IsEmpty()))


:class:`~screenpy_selenium.questions.text.Text`

Before::

the_actor.shall(See.the(Text(TARGET, True), IsEqual("foo"))

After::

the_actor.shall(See.the(Text(TARGET, multi=True), IsEqual("foo")


1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ to :class:`~screenpy_selenium.abilities.BrowseTheWeb`!
extended_api
targets
cookbook
deprecations
4 changes: 2 additions & 2 deletions tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def new_method(self) -> bool:

def test_positional_arg_warns(self) -> None:
with pytest.warns(DeprecationWarning):
HoldDown(Keys.LEFT_ALT, True)
HoldDown(None, True)
bandophahita marked this conversation as resolved.
Show resolved Hide resolved

def test_keyword_arg_does_not_warn(self) -> None:
with warnings.catch_warnings():
Expand Down Expand Up @@ -913,7 +913,7 @@ def new_method(self) -> bool:

def test_positional_arg_warns(self) -> None:
with pytest.warns(DeprecationWarning):
Release(Keys.LEFT_ALT, True)
Release(None, True)

def test_keyword_arg_does_not_warn(self) -> None:
with warnings.catch_warnings():
Expand Down
Loading