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

Add dummy as a known platform, and use it in tests #1534

Merged
merged 48 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
547a36b
Add as a known platform, and use it in tests
bruno-rino Jul 27, 2022
0bce426
Use TestCase's setUp and tearDown to set and reset the the current fa…
bruno-rino Jul 29, 2022
79bfdd4
Fix flake8 issues
bruno-rino Aug 16, 2022
c368522
Add test for platform selection
bruno-rino Aug 16, 2022
b94be8e
Updated tests for CI environment, where the native platform factory i…
bruno-rino Aug 17, 2022
24ed0ed
Check availablity of the native platform factory before it is overriden
bruno-rino Aug 17, 2022
dbbea6e
Fix flake8 issues
bruno-rino Aug 17, 2022
2f6bca4
Trying to keep codecov happy by using skipTest
bruno-rino Aug 17, 2022
ad9db8a
Mock toga_gtk for the CI environment benefit
bruno-rino Aug 21, 2022
a4d8be6
Fix flake8 issues
bruno-rino Aug 21, 2022
eca2d97
Exploiting distutils extension points for toga backends
bruno-rino Aug 25, 2022
78ce15b
Merge branch 'main' into add_dummy_platform
bruno-rino Aug 25, 2022
ab675ab
Remove most "factory=toga_dummy.factory" parameters from tests
bruno-rino Aug 25, 2022
f9b8c61
Bump the dependency on importlib_metadata.
freakboy3742 Aug 26, 2022
dd9a93b
Add missing "[options.entry_points]" section title
bruno-rino Aug 26, 2022
d98fe31
web backends are deployment shims, rather than full "toga.backends"
bruno-rino Aug 26, 2022
0d92fca
More precise error messages
bruno-rino Aug 26, 2022
8e83571
Merge branch 'main' into add_dummy_platform
bruno-rino Sep 6, 2022
c3396bf
remove references to toga_dummy
bruno-rino Sep 6, 2022
30d9789
Improve test coverage
bruno-rino Sep 6, 2022
ae95371
Deprecate custom factory argument from get_platform_factory
bruno-rino Sep 7, 2022
439defa
Deprecate factory argument from bind() methods
bruno-rino Sep 7, 2022
095e5a3
Override the toga platform to use in tests
bruno-rino Sep 8, 2022
ae79748
Deprecate factory argument from widget constructors
bruno-rino Sep 8, 2022
630e4f8
Merge branch 'main' into add_dummy_platform
bruno-rino Sep 8, 2022
91a1279
Override the toga platform in all tests that use toga_dummy.utils.Tes…
bruno-rino Sep 9, 2022
27cde92
Fix testbed apps when no backend is specified
bruno-rino Sep 9, 2022
d2225a7
Fix typo
bruno-rino Sep 9, 2022
b5e3540
Temporarily disable the platform override
bruno-rino Sep 12, 2022
74d90b4
Fix flake8 issues
bruno-rino Sep 12, 2022
4497d4c
Make the platform overridde more concise and explicit
bruno-rino Sep 12, 2022
8c3aad2
Allow platform overridde via environment variable
bruno-rino Sep 12, 2022
9b4bd77
The platform override in TestCase is opt-in
bruno-rino Sep 16, 2022
866c81f
Turn up verbosity on tests, and be explicit about the test platform.
freakboy3742 Sep 27, 2022
6fa5f04
Clean up error messages for platform use.
freakboy3742 Sep 27, 2022
db45e6e
Use a different mechanism to set environment variables.
freakboy3742 Sep 27, 2022
49051fb
Change the environment variable override to target backends instead o…
bruno-rino Sep 29, 2022
70ee010
Set the TOGA_BACKEND environment variable to run tests
bruno-rino Sep 29, 2022
1443cc6
Merge remote-tracking branch 'origin/main' into add_dummy_platform
bruno-rino Sep 29, 2022
520a02b
Merge branch 'main' into add_dummy_platform
mhsmith Oct 20, 2022
b133746
Fix tests
mhsmith Oct 20, 2022
5aa5439
Merge branch 'pre-commit' into add_dummy_platform
mhsmith Oct 21, 2022
01289b9
Apply pre-commit
mhsmith Oct 21, 2022
66b4687
Merge branch 'main' into add_dummy_platform
freakboy3742 Oct 21, 2022
4fd31f0
Merge branch 'main' into add_dummy_platform
freakboy3742 Oct 26, 2022
1a853a7
Minor cleanups to messaging and options in platform selection.
freakboy3742 Oct 26, 2022
192fb9a
Update contribution guide to remove some redundant instructions.
freakboy3742 Oct 26, 2022
9491665
Merge branch 'main' into add_dummy_platform
freakboy3742 Oct 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/core/toga/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def get_platform_factory(factory=None):
if factory is not None:
return factory

if current_platform == 'dummy':
from toga_dummy import factory
return factory
if current_platform == 'android':
from toga_android import factory
return factory
Expand Down
3 changes: 3 additions & 0 deletions src/dummy/toga_dummy/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import sys
import unittest

import toga.platform
from travertino.declaration import BaseStyle
from travertino.layout import BaseBox
from travertino.size import BaseIntrinsicSize

toga.platform.current_platform = 'dummy'


def not_required(method_or_class):
""" This decorator function is used to mark methods or classes
Expand Down