summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-30 17:42:13 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-03-31 13:29:54 +0200
commited2ffff16c44737eaf8cef73d7e7b66170dc7be6 (patch)
tree1b88d097eede9055e232eb6f184947bb4bff8df0
parentbdf84abf75362f96d38b8441e2c0a41a1cf54472 (diff)
downloadqutebrowser-ed2ffff16c44737eaf8cef73d7e7b66170dc7be6.tar.gz
qutebrowser-ed2ffff16c44737eaf8cef73d7e7b66170dc7be6.zip
flatpak: Skip download dispatcher tests
(cherry picked from commit 40c72f849d35cde1644558792845d93e3032ea93)
-rw-r--r--pytest.ini1
-rw-r--r--tests/conftest.py4
-rw-r--r--tests/end2end/features/downloads.feature8
-rw-r--r--tests/unit/utils/test_utils.py10
4 files changed, 21 insertions, 2 deletions
diff --git a/pytest.ini b/pytest.ini
index 7f4a58de3..4873152ea 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -17,6 +17,7 @@ markers =
mac: Tests which only can run on macOS.
not_mac: Tests which can not run on macOS.
not_frozen: Tests which can't be run if sys.frozen is True.
+ not_flatpak: Tests which can't be run if running with Flatpak.
no_xvfb: Tests which can't be run with Xvfb.
frozen: Tests which can only be run if sys.frozen is True.
integration: Tests which test a bigger portion of code
diff --git a/tests/conftest.py b/tests/conftest.py
index ee945ac4c..b75dfda16 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -93,6 +93,10 @@ def _apply_platform_markers(config, item):
pytest.mark.skipif,
getattr(sys, 'frozen', False),
"Can't be run when frozen"),
+ ('not_flatpak',
+ pytest.mark.skipif,
+ version.is_flatpak(),
+ "Can't be run with Flatpak"),
('frozen',
pytest.mark.skipif,
not getattr(sys, 'frozen', False),
diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature
index 1433f4c0a..dfdb24704 100644
--- a/tests/end2end/features/downloads.feature
+++ b/tests/end2end/features/downloads.feature
@@ -290,6 +290,7 @@ Feature: Downloading things from a website.
And I wait for "File successfully written." in the log
Then the downloaded file Test title.mhtml should exist
+ @not_flatpak
Scenario: Opening a mhtml download directly
When I set downloads.location.prompt to true
And I open /
@@ -404,18 +405,21 @@ Feature: Downloading things from a website.
## :download-open
+ @not_flatpak
Scenario: Opening a download
When I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I open the download
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with a placeholder
When I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I open the download with a placeholder
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with open_dispatcher set
When I set a test python open_dispatcher
And I open data/downloads/download.bin without waiting
@@ -423,6 +427,7 @@ Feature: Downloading things from a website.
And I run :download-open
Then "Opening *download.bin* with [*python*]" should be logged
+ @not_flatpak
Scenario: Opening a download with open_dispatcher set and override
When I set downloads.open_dispatcher to cat
And I open data/downloads/download.bin without waiting
@@ -446,6 +451,7 @@ Feature: Downloading things from a website.
## opening a file directly (prompt-open-download)
+ @not_flatpak
Scenario: Opening a download directly
When I set downloads.location.prompt to true
And I open data/downloads/download.bin without waiting
@@ -466,6 +472,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/1725
+ @not_flatpak
Scenario: Directly open a download with a very long filename
When I set downloads.location.prompt to true
And I open data/downloads/issue1725.html
@@ -530,6 +537,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/2173
+ @not_flatpak
Scenario: Remembering the temporary download directory (issue 2173)
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
index b43638cb3..c9c124a0a 100644
--- a/tests/unit/utils/test_utils.py
+++ b/tests/unit/utils/test_utils.py
@@ -725,6 +725,7 @@ class TestGetSetClipboard:
class TestOpenFile:
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_cmdline_without_argument(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass'.format(executable)
@@ -734,6 +735,7 @@ class TestOpenFile:
r'Opening /foo/bar with \[.*python.*/foo/bar.*\]', result)
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_cmdline_with_argument(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass {{}} raboof'.format(executable)
@@ -743,6 +745,7 @@ class TestOpenFile:
r"Opening /foo/bar with \[.*python.*/foo/bar.*'raboof'\]", result)
@pytest.mark.not_frozen
+ @pytest.mark.not_flatpak
def test_setting_override(self, caplog, config_stub):
executable = shlex.quote(sys.executable)
cmdline = '{} -c pass'.format(executable)
@@ -772,8 +775,11 @@ class TestOpenFile:
parsed=version.Distribution.kde_flatpak,
version=VersionNumber.parse('5.12'),
pretty='Unknown')
- monkeypatch.setattr(version, 'distribution',
- lambda: info)
+
+ if not version.is_flatpak():
+ monkeypatch.setattr(version, 'distribution', lambda: info)
+
+ assert version.is_flatpak()
def test_cmdline_sandboxed(self, sandbox_patch,
config_stub, message_mock, caplog):