Commit Graph

69 Commits

Author SHA1 Message Date
Florian Bruhin 5fa878c7d1 py38: Run modified pyupgrade
Modified to leave f-strings alone for now, and also not do some other
stuff we should do separately:

    diff --git i/pyupgrade/_main.py w/pyupgrade/_main.py
    index 4292174..37547b3 100644
    --- i/pyupgrade/_main.py
    +++ w/pyupgrade/_main.py
    @@ -294,7 +294,8 @@ def _fix_tokens(contents_text: str) -> str:
                    token.utf8_byte_offset == 0 and
                    token.line < 3 and
                    token.name == 'COMMENT' and
    -                tokenize.cookie_re.match(token.src)
    +                tokenize.cookie_re.match(token.src) and
    +                False
            ):
                del tokens[i]
                assert tokens[i].name == 'NL', tokens[i].name
    diff --git i/pyupgrade/_plugins/fstrings.py w/pyupgrade/_plugins/fstrings.py
    index e648075..eb44c0c 100644
    --- i/pyupgrade/_plugins/fstrings.py
    +++ w/pyupgrade/_plugins/fstrings.py
    @@ -88,7 +88,7 @@ def _format_params(call: ast.Call) -> set[str]:
        return params

    -@register(ast.Call)
    +# @register(ast.Call)
    def visit_Call(
            state: State,
            node: ast.Call,
    diff --git i/pyupgrade/_plugins/open_mode.py w/pyupgrade/_plugins/open_mode.py
    index a20b95c..0388781 100644
    --- i/pyupgrade/_plugins/open_mode.py
    +++ w/pyupgrade/_plugins/open_mode.py
    @@ -28,7 +28,7 @@ def _permute(*args: str) -> tuple[str, ...]:
        return tuple(''.join(p) for s in args for p in itertools.permutations(s))

    -MODE_REMOVE = frozenset(_permute('U', 'r', 'rU', 'rt'))
    +MODE_REMOVE = frozenset(_permute('U', 'rU', 'rt'))
    MODE_REPLACE_R = frozenset(_permute('Ub'))
    MODE_REMOVE_T = frozenset(_plus(_permute('at', 'rt', 'wt', 'xt')))
    MODE_REMOVE_U = frozenset(_permute('rUb'))

Then run with:

    git ls-files | grep -E '(\.py|misc/userscripts)' | xargs ~/tmp/pyupgrade/.venv/bin/pyupgrade --py38-plus

And manually reverted some changes (e.g. it picking up bash userscripts)
2023-06-26 14:39:54 +02:00
Florian Bruhin c5a51eb0bc Drop Qt < 5.15
Fixes #7091

TODO: Add changelog
2022-08-23 18:31:41 +02:00
Florian Bruhin 236371cb1d Fix up various webkit/webengine imports 2022-08-23 18:31:40 +02:00
Florian Bruhin d47cfd99d7 Run scripts/dev/rewrite_qt_imports.sh 2022-08-23 18:09:11 +02:00
Florian Bruhin bd8c940320 Simplify some syntax
Found via pyupgrade
2022-04-03 12:18:09 +02:00
Jimmy 6341154aeb Skip debucachestats test on python < 3.9
Refactor the magic tag creation thing to add python version checking support.
Makes `_check_version()` support checking plain tuples to so that I don't have
to copy the operator dict.

Now most of the branches of the if/else are the same, meh.
2022-03-26 16:06:42 +13:00
Florian Bruhin 9c4169c7b7 tests: Remove some unused imports 2022-02-11 13:12:43 +01:00
Florian Bruhin 4ace7502c5 Update docs/changelog 2021-11-13 19:04:45 +01:00
Philipp Albrecht 7fcfb9b635 Enable overriding of backend auto-detection
One can override the auto-detection mechanism by passing
the backend via --qute-bdd-backend=<backend> or by setting the
environment variable QUTE_BDD_BACKEND=<backend>.
2021-11-05 15:50:41 +01:00
Florian Bruhin 54a0dc1e38 notifications: Replace @qtwebengine_py_5_15 by @pyqtwebengine>=5.15 2021-03-25 15:41:56 +01:00
Florian Bruhin 2f592f7ce6 Merge remote-tracking branch 'origin/pr/5457' into dev 2021-03-24 14:12:36 +01:00
Lembrun f2f2acd5ba Fixed joinpath plus cleaner path 2021-03-11 13:23:09 +01:00
Lembrun 6d0b7cb12b Replaced os.path objects by pathlib equivalent in tests/end2end/ 2021-03-10 17:02:29 +01:00
Florian Bruhin 6d8e21d366 tests: Skip "Using JS after window.open" on Windows
Seems to be flaky pretty consistantly there...
See #5390
2021-01-27 14:08:49 +01:00
Florian Bruhin 1a4fff1a42 doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
Florian Bruhin 222f1f19a1 Bump copyright years
Closes #6015
2021-01-20 20:06:19 +01:00
Florian Bruhin 3fd4d106eb tests: Add second server fixture
Can be used to e.g. test cross-origin requests
2020-11-23 17:36:42 +01:00
Florian Bruhin a14d0d433e old qt: Simplify various version checks 2020-11-04 18:30:04 +01:00
Florian Bruhin e02e262a04 tests: Skip pdf.js disabled test on QtWebKit with PDF image plugin
Since Qt 5.15, QtWebEngine comes with Qt PDF as TP:
https://wiki.qt.io/New_Features_in_Qt_5.15#Technology_Preview_Modules

This also includes a new PDF image plugin in
/usr/lib/qt/plugins/imageformats/libqpdf.so. Due to that, QtWebKit now displays the
PDF's first page as image rather than triggering a download.

See https://github.com/qtwebkit/qtwebkit/issues/1013

Thus, detect this condition (both QtWebKit and QtWebEngine installed) and skip the test
in that scenario.
2020-08-05 15:01:21 +02:00
Ash 0e62da45ad Don't run notification tests on QtWebKit. 2020-07-08 20:26:21 -07:00
Ash 2ba6cce9eb Merge branch 'master' into dbus-notify 2020-07-08 17:33:59 -07:00
Florian Bruhin a6817bd086 tests: Fix JS header tests
This is a follow-up to f0eed465ab
See #4657
2020-06-19 16:21:03 +02:00
Ash e96313ae83 flake8/pylint fixes for notification code 2020-06-04 00:06:05 -07:00
Ash 77d4d3f4d4 Add support for onclose callbacks on notifications. 2020-06-03 23:43:26 -07:00
Ash 2205693f47 Hook up running the test notification server. 2020-06-03 20:47:28 -07:00
Florian Bruhin 9e4276db9b Adjust copyrights for 2020 2020-01-04 18:21:17 +01:00
Florian Bruhin 01aea3d67c Enable QtWebEngine notification tests on >= 5.13 2019-07-05 18:25:59 +02:00
Jay Kamat 3e816f5f8b
Update copyright for 2019 2019-02-22 21:45:08 -08:00
Florian Bruhin 7e8c741937 Set compiled=False for BDD Qt comparisons
We often check for bugs and not APIs there.
2018-07-03 13:10:15 +02:00
Florian Bruhin 11b957f24b tests: Adjust getting markers for pytest 3.6 2018-06-07 19:29:01 +02:00
Florian Bruhin f3aaa1084a Migrate spell tests to unittests 2018-02-28 08:08:23 +01:00
Florian Bruhin 6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Florian Bruhin 430126dcc8 pylint: Re-enable ungrouped-imports 2017-12-15 23:08:53 +01:00
Florian Bruhin e76732693c Fix wrong import order 2017-12-15 14:35:07 +01:00
George Edward Bulmer 9ca6baca4f Modify instances of re.match to fullmatch or search.
This applies the changes to the tests directory only.
2017-12-12 15:07:37 +00:00
Michal Siedlaczek 3ac2cfdf73 Support updating dictionaries and removing old versions. 2017-11-04 18:16:05 -04:00
Florian Bruhin 023c59f8c0 Reset the webserver process correctly between tests
If we don't call before_test(), if the server shows an error, all following
tests will fail.

See #3207
2017-10-28 17:29:55 +02:00
Florian Bruhin dfe2f9e38c Also check PyQt version for qtutils.version_check()
With an older PyQt built against a newer Qt, we still don't have its features
available.

This also drops support for exact=True with compiled=True as the semantics for
that are unclear, and it's not used.
2017-10-12 19:13:20 +02:00
Michal Siedlaczek 932e7a9ab9 Review fixes 2017-10-03 20:07:06 -04:00
Michal Siedlaczek b840b8066b Spell only when pyqt>=5.8 2017-09-22 11:16:59 -04:00
Michal Siedlaczek 2150154350 Skip end2end spell tests if a dictionary is/isn't installed 2017-09-21 16:36:47 -04:00
Florian Bruhin ef1c83862b Use utils.is_* for platform checks everywhere 2017-09-20 11:10:24 +02:00
Florian Bruhin 55a4eb18f2 Get rid of httpbin
Fixes #2949
2017-09-19 10:35:54 +02:00
Florian Bruhin 3772dc5930 Drop legacy QtWebKit support
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin ad615941a2 Replace OS X with macOS 2017-07-08 11:12:43 +02:00
Florian Bruhin 822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin bffdea6719 Read qWebKitVersion in qtutils.is_webkit_ng.
This means we need to try and import qWebKitVersion in qtutils, but better there
than at every place which calls it.
2017-04-28 21:36:02 +02:00
Florian Bruhin c23e4b1c5f tests: Allow @qt<... marker for BDD tests 2017-04-08 19:20:53 +02:00
Florian Bruhin 0b5838f9fd Fix BDD version check operators 2017-03-08 20:56:30 +01:00
Florian Bruhin f86f9cd92a Refactor qtutils.version_check API
Fixes #2423
2017-03-08 08:41:18 +01:00