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

Use latest dependencies for Testbed testing #2652

Merged
merged 4 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,14 @@ updates:
interval: "weekly"
day: "sunday"
time: "20:00"

- package-ecosystem: "pip"
directory: "/testbed"
ignore:
# pin PIL for Android and iOS
- dependency-name: "pillow"
schedule:
# Check for updates on Sunday, 8PM UTC
interval: "weekly"
day: "sunday"
time: "20:00"
1 change: 1 addition & 0 deletions changes/2382.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Testbed tests were updated to use the latest testing dependencies.
31 changes: 17 additions & 14 deletions testbed/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# This project was generated using template: https://github.com/beeware/briefcase-template and branch: v0.3.12
[project]
name = "testbed"
version = "0.0.1"
dependencies = ["../core"]

[project.optional-dependencies]
test = [
rmartin16 marked this conversation as resolved.
Show resolved Hide resolved
"coverage==7.5.3",
# fonttools is only needed by Android, but we need to use
# sys.platform == 'linux' as there's no dependency identifier
# that can target Android exclusively until 3.13 lands.
"fonttools==4.53.0 ; sys.platform == 'linux'",
"pillow==9.2.0",
"pytest==8.2.2",
"pytest-asyncio==0.23.7",
]

[tool.briefcase]
project_name = "Toga Testbed"
bundle = "org.beeware.toga"
version = "0.0.1"
url = "https://beeware.org"
license.file = "LICENSE"
author = "Tiberius Yak"
Expand All @@ -18,15 +33,6 @@ sources = [
test_sources = [
"tests",
]
requires = [
"../core",
]
test_requires = [
"coverage==7.2.0",
"pytest==7.2.0",
"pytest-asyncio==0.20.3",
"pillow==9.2.0",
]

permission.camera = "The testbed needs to exercise Camera APIs"
permission.fine_location = "The testbed needs to exercise fine-grained geolocation services."
Expand Down Expand Up @@ -76,9 +82,6 @@ test_sources = [
requires = [
"../android",
]
test_requires = [
"fonttools==4.42.1",
]

base_theme = "Theme.MaterialComponents.Light.DarkActionBar"

Expand Down
20 changes: 14 additions & 6 deletions testbed/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,22 @@ async def main_window_probe(app, main_window):

# Controls the event loop used by pytest-asyncio.
@fixture(scope="session")
def event_loop(app):
loop = ProxyEventLoop(app._impl.loop)
yield loop
loop.close()
def event_loop_policy(app):
yield ProxyEventLoopPolicy(ProxyEventLoop(app._impl.loop))


# Proxy which forwards all tasks to another event loop in a thread-safe manner. It
# implements only the methods used by pytest-asyncio.
# Loop policy that ensures proxy loop is always used.
class ProxyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):
def __init__(self, proxy_loop: "ProxyEventLoop"):
super().__init__()
self._proxy_loop = proxy_loop

def new_event_loop(self):
return self._proxy_loop


# Proxy which forwards all tasks to another event loop in a thread-safe manner.
# It implements only the methods used by pytest-asyncio.
@dataclass
class ProxyEventLoop(asyncio.AbstractEventLoop):
loop: object
Expand Down
Loading