534 Commits

Author SHA1 Message Date
Egor.Eliseev
cb37afc53e PY-72060-DjangoTemplateDebuggerTest failed
Fix Log/Condition breakpoints for debugger plugins.
Fix Step Into, Step Over commands for debugger plugins


Co-authored-by: Andrey Lisin <andrey.lisin@jetbrains.com>

Merge-request: IJ-MR-132334
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: b495a41fe37f61e4271d3438bab37846e0013006
2024-05-23 18:34:19 +00:00
Egor.Eliseev
f48b41f61f PY-35986 Allow a user to run doctests with pytest
Run Doctest via pytest configuration if `pytest` is installed and selected in settings


Merge-request: IJ-MR-130194
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 4c97411c3da69249e6b9ad886bcbd9a206db744b
2024-04-05 10:15:58 +00:00
Ilia Zakoulov
21eb2fb866 PY-66522: Change django package to com.intellij.python.django.
Django plugin should have a uniq package name.
The previous package name was clashing with PythonId.

GitOrigin-RevId: e680e460d5ef9dff21c457e89e26568c81523d9a
2024-03-05 20:21:15 +00:00
Ilya.Kazakevich
5559ad4fbb [python] rename com.jetbrains.pythonPro -> >com.intellij.python.pro
Nothing else changed: 2 dirs renamed (src and gen) and autoreplace in all files

GitOrigin-RevId: fb9a1b149d748966971e22ef0ef19a9a7fe4e449
2024-01-16 20:38:58 +00:00
Ilya.Kazakevich
3ce043468e [python] move pro packages to com.jetbrains.pythonPro as step to v2
GitOrigin-RevId: 3498c34e337dbd6a222c4fef6f3d8341556c869a
2024-01-13 23:31:12 +00:00
Egor.Eliseev
4e46197503 PY-53355 Warning when running Django tests: The extra_tests argument is deprecated
Remove the 'extra_tests' argument if a Django version >= 4.0


Merge-request: IJ-MR-120964
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: d9274d828827112a01fd04d0ea62f4df945772af
2023-12-01 22:54:12 +00:00
Pavel Karateev
329889fe1b [python] Fix PY-62800 teamcity-messages breaking pytest integration
Passing `name=None` to old API was redundant,
for the new one - mistaken.

(cherry picked from commit 4a1f8a20d1f792623623a86d42c70c423e32ec91)

IJ-CR-115023

GitOrigin-RevId: f6f1330069cb211ec9578c7534023f9f0812a67c
2023-10-09 10:55:31 +00:00
Andrey Lisin
ebf48ef4f1 PY-59015 Fix accidental skip of Django import when distutils are not available
GitOrigin-RevId: eb1d99ca9c297f247a36f1c277b3fac1b535b282
2023-10-09 09:04:23 +00:00
Andrey Lisin
f2b4812360 PY-59015 Compatibility with Python 3.12 after deprecation of distutils package
GitOrigin-RevId: 0fc04d628d85a1d4f0fc3437b1304ba82677ddc4
2023-09-20 13:34:37 +00:00
Egor.Eliseev
fbf14c190d PY-43327 Add parameters to doctest configuration
Remove pydev warning if old trace function equals to new one.
Add argparse for `docrunner.py`.
Add tests for `doctest` with parameters.
Add debugger tests for `doctest` with parameters.


Merge-request: IJ-MR-111959
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 608080b3b5db93718f62a3dddd17893fe8118539
2023-09-04 13:18:44 +00:00
Egor.Eliseev
85f315a921 PY-61231 DeprecationWarning pkg resources is deprecated as an API
Use `importlib.metadata` for the new Python versions (>= 3.10).
Ignore `DeprecationWarning` for old versions of Python.


Merge-request: IJ-MR-111445
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: a639ae84016a85d508484e31e48913543d4e51f1
2023-08-21 09:55:07 +00:00
Ilya.Kazakevich
438755a189 PY-59719: Mark unfinished tests as ignored.
When pytest stops with ``pytest.stop`` started test is not finished nor failed, so IJ shows it as "running". We now mark it as "ignored" explicitly.

(cherry picked from commit 83db3d319466ab25ce54bdcbff55bdc25f81d529)

IJ-MR-105333

GitOrigin-RevId: 68047929f947d9d9388389f9dddce896ce81bb72
2023-03-29 00:54:56 +00:00
Ilya.Kazakevich
f0ee9eec09 PY-57956: Support tox4.
It has different API, so we now have two separate modules.

Merge-request: IJ-MR-102673
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 0a2dd2f74376662a34e8b782883f6631dc2a42b1
2023-02-14 17:13:37 +00:00
Ilya.Kazakevich
9614f73c67 CWM-2243: Close suites on the Python side.
Python runners aren't aware of suites: they report ``fully.qualified.test.names``.

These names are splitted to the suites on the Python side, and just before process ends we close all of them.

GitOrigin-RevId: 4e1ad5b308cd393ac8877e1f6e1f616b254a130c
2023-02-01 17:43:40 +00:00
Alexander Koshevoy
98d818cf53 Fix "ValueError: Empty module name" when project dir (first argument of django_test_manage.py) ends in a slash
Note that `os.path.basename(path)` returns an empty string (`''`) when `path` ends in a slash.

GitOrigin-RevId: e400e794d5e0de0cf29ab6796ffac5972f50eb53
2022-02-08 23:25:31 +00:00
Ilya.Kazakevich
da81b0c2d3 Get rid of deprecated method
load_module is deprecated

GitOrigin-RevId: 9a026832e43ae906593c34eab62443bbba0be2d4
2022-01-14 21:36:39 +00:00
Ilya.Kazakevich
f48f813c9a Get rid of deprecated method
load_module is deprecated

GitOrigin-RevId: 390cc2849dfd83b09a4712ac524181f7040b5e61
2022-01-14 17:09:01 +00:00
Ilya.Kazakevich
735f2f3406 PY-51870: Pretty print primitives and dicts
GitOrigin-RevId: d4e57ba58186ffaea4751f150d9564eeeac4476c
2021-12-14 16:25:53 +00:00
Ilya.Kazakevich
cd4e6494a8 PY-32605: use repr for diff in pytest
``assert "[]" == []``
``assert "123" == 123``

is only displayed correctly when we ``repr`` both

GitOrigin-RevId: ff962dffe7341e95ceeda613e557e9de5cb2620f
2021-10-01 10:10:12 +00:00
Semyon Proshev
96ca67b701 Remove support for buildout (PY-49193)
GitOrigin-RevId: 6c9e582d92b7c1c5f43648022abe315906e2786c
2021-09-14 17:08:51 +00:00
Ilya.Kazakevich
3d3c32b0e9 sync teamcity-messages with TC
GitOrigin-RevId: 87ed5cd75205c1cf21ffb43ca3f8fc77bb30c7ca
2021-09-14 14:06:51 +00:00
Bernát Gábor
9cfe2170d3 PY-49452: Do not use distutils package in pytest runner
As it's slated for removal in 3.12 and 3.10 now shows a red deprecation warning.

GitOrigin-RevId: 8badfb3feaab932eb2abf3f44278d0c7d1d4bbcd
2021-09-14 12:47:33 +00:00
Ilya.Kazakevich
362abf7119 Don't use deprecated package distutils, drop ancient behave workaround
GitOrigin-RevId: c116d24976014f5b9ed697d472bd8a9d5a478db9
2021-09-14 12:47:31 +00:00
Ilya.Kazakevich
0d1f3eb8b1 PY-49505: Fix multiline pytest diff
Fixed by
b03ddbfadf

GitOrigin-RevId: 3d1be37673a0b4e6cb5639cda01193a90b326ac1
2021-09-01 19:49:47 +00:00
Ilya.Kazakevich
6a1902e7be PY-49658: fix "--jb-swapdiff" option
Fixed by merging correct version of teamcity runners.
Boolean option brakes all other arguments when used incorrectly

GitOrigin-RevId: e61955cb10fc98eb3dcf741650b79c64a5a573fc
2021-07-20 01:11:06 +00:00
Ilya.Kazakevich
41e0118cc0 PY-48468: Add option to disable "--no-summary" in "Advanced settings".
No need to show summary for pytest in most cases, but some plugins may need it.
So, we add advanced option to enable that

GitOrigin-RevId: 15106a4a68ea2adc048119ad4b45e82640086ce0
2021-06-08 00:00:21 +00:00
Ilya.Kazakevich
9283187fc6 PY-44421: Add new version of plugin that supports passing argument as swap
GitOrigin-RevId: d6a2a0822b2aff65480974b75d1652cc36f319f7
2021-05-21 18:23:58 +00:00
Ilya.Kazakevich
ccca94449f Fixing test after removing legacy test runners
This part was removed by accident

GitOrigin-RevId: d757ed7a3a15125554302803dd58d5994434c6e5
2021-05-21 17:41:03 +00:00
Ilya.Kazakevich
c722b28671 Remove legacy tests
Legacy tests were used for python 2.6, we do not need them anymore

GitOrigin-RevId: bf9137d15e11b40320848e07e2cf3713f23607ce
2021-05-20 16:29:32 +00:00
Ilya.Kazakevich
fabfc4dcc7 PY-47625: Fix doctest runner according to the new API
One argument is missing because API changed many versions ago

GitOrigin-RevId: fb1f8e0befc4ecd0307e602581cf8e5df0eb1e7a
2021-03-30 17:18:09 +00:00
Ilya.Kazakevich
b12ce46fb3 PY-45405: Support pytest < 6.0
GitOrigin-RevId: 1004ca613f7846fa9a3be76b1cceb5d5028a1f8d
2021-01-26 14:06:45 +00:00
Ilya.Kazakevich
81c06493f5 PY-45096: Do not show internal modules in stack trace
Implemented in teamcity-messages

GitOrigin-RevId: 312e7d71009ff66bc22b7ba2d382169e596608b8
2020-12-29 23:42:37 +00:00
Ilya.Kazakevich
fef6e000c1 PY-45096: Report exception type in diff
GitOrigin-RevId: 3b580be875b803a4b9dccecf86c80a4e2b580746
2020-12-22 20:10:15 +00:00
Ilya.Kazakevich
eea900c902 PY-45096: Wrong line for pytest diff called by assertEquals
Logic implemented in ``teamcity-messages``, see changes in diff_tools.py and pytest_plugin.py

GitOrigin-RevId: 8e9cc8cb350e33a9a1cb49ea78ed7ad29c4e1f96
2020-12-17 02:01:55 +00:00
Ilya.Kazakevich
cfee024f04 PY-45405: Do not report same failure several times
* Remove header and footer from pytest
* Do not report default magnitude index title

GitOrigin-RevId: 217afc00e77c725dd76a0897d78d8984ec0d0494
2020-12-16 17:34:24 +00:00
Ilya.Kazakevich
7d364774aa PY-45405: Do not report same failure several times
* Remove header and footer from pytest
* Do not report default magnitude index title

GitOrigin-RevId: a119bf2a1edbc777a359cc3778f475eec69d4188
2020-12-16 14:52:38 +00:00
Ilya.Kazakevich
9303000813 Rewrite get_wsl_ip to C and bundle binary.
It seems that every IJ product needs to know WSL-2 IP, but there are no guarantees for an interpreter/runtime to exist on WSL except glibc and kernel of course.

Binary tool runs everywhere.

It must be compiled statically on the oldest Linux possible. It gives us guarantee that it runs on distros without of glibc (i.e. Alpine).

GitOrigin-RevId: 92b26d4e176cc3a46ede7970a2b08a228d0f89b7
2020-11-18 20:21:35 +00:00
Ilya.Kazakevich
0569005a3c PY-43681: Drop lettuce
Unsupported framework from 2016 which can't run on Py3K. Migrate to Behave.

GitOrigin-RevId: 3bcc1e6b13f117050767d9ef137e13cd80e54a3a
2020-07-31 21:19:15 +00:00
Ilya.Kazakevich
cb899e1dad Warn user if legacy runner is used, remove outdated EP, mark redundant interface as deprecated
GitOrigin-RevId: 9ead5bcf99fd87fb5bde6d6fa88426ddfefebab8
2020-04-26 22:37:36 +00:00
Ilya.Kazakevich
195006a291 Sync teamcity-messages with upstream (should fix PY-41830)
GitOrigin-RevId: 7860d3cee7a035e2e90b6c79b5d10d9dbd9ceb89
2020-04-22 13:51:52 +00:00
Ilya.Kazakevich
b38c954f97 PY-41270: new test runners use `pytest_collection_finish`
``pytest_collection_finish`` is the correct way to obtain number of tests.

GitOrigin-RevId: c636ccc73b176094f113c83cccac91e598708efc
2020-03-26 13:31:44 +00:00
Ilya.Kazakevich
4508e0de9d PY-31836: Use pytest parameter as test name, not keyword.
The correct way to use parameters is to add them to the test name.
"-k" is also works in some cases, but it is not official nor stable.

* pytest runner reports "testname[param]" as metainfo
* we fetch param
* add "parameters" field to the pytest
* glue it with test name

GitOrigin-RevId: 56c5d93fd93a12ba5742b21af51ea04823a9d8f7
2019-12-30 13:34:33 +00:00
Ilya.Kazakevich
820a665815 PY-29154: Return test runner exit code
When test runner returns code > 0 (because of test failure), our runner must do the same.

See issue description for the reason

GitOrigin-RevId: 231c9ab337e80f70872bf6e6f61a397599f18e26
2019-12-23 20:53:08 +00:00
Ilya.Kazakevich
c51f222882 PY-39146: Do not use deprecated API.
See ``load()`` body

GitOrigin-RevId: 822dd2033d2f306c82400c8b1bb29fd769207d7e
2019-12-10 21:08:52 +00:00
Ilya.Kazakevich
75291026e7 PY-29614: Subtests are broken when have names.
Fixed on teamcity-runners side. This commit updates em to the latest version and adds test.
See https://github.com/JetBrains/teamcity-messages/issues/221

GitOrigin-RevId: 2538e88844be6b0f337983e2629985c872ac4f71
2019-11-12 16:40:42 +00:00
Ilya.Kazakevich
4c03903874 PY-31170: Use `PWD` to get workdir in tests because getcwd resolves symlinks.
According to POSIX, getcwd must resolve symbolic links.
But links in backtrace should not be resolved, otherwise link might point to some dir outside of project root.

We check ``PWD`` (works for bash) with fallback to ``
getcwd``

GitOrigin-RevId: 449e5961d0d59c3fe9a627351c79deb83805d58d
2019-11-07 02:40:58 +00:00
Ilya.Kazakevich
9059da3f88 PY-36563: Support WSL2 and simple refactoring to remove copy/paste (PyRemoteCommandLinePatcher)
* Remote process command line must be patched to support debug, profile etc.
It is now done with PyRemoteCommandLinePatcher.kt

* WSL2 must run with closed stdin because of MS bug.
So, we check if we are on WSL2, and close it.

* WSL2 uses different approach to connect to host for debug (see PyWSLSocketProvider)

* WSL2 needs several commands to run to get list of mappings, so we wrap it with modal dialog.

GitOrigin-RevId: 1789afd9832f048d10d972f5e0f23977e92f973f
2019-10-16 19:25:54 +00:00
Ilya.Kazakevich
29ca363a7c PY-37841: Use official hook API to parse config instead of dirty hack.
See Bruno's comment in issue.

GitOrigin-RevId: af0c4bee1f415a2148e7a824630a949ba3db0051
2019-10-01 00:31:27 +00:00
Ilya.Kazakevich
ef0b36a968 PY-37841: Do not monkeypatch prepareconfing in pytest: leads to double plugin loading.
With testdir fixture, pytest runs test under separate pytest (which may be inline or separate process).

Previously we monkeypatched prepareconfig not to call it twice.
But this approach fails with testdir, because same config returned twice leading to double plugin registration.
See comment in YT

GitOrigin-RevId: bd9f11a2a10900fa3c059791d7c0183a20b1ed70
2019-10-01 00:31:27 +00:00
Ilya.Kazakevich
c4e61f6c9a IDEA-CR-52314 PY-31751: fox after review
GitOrigin-RevId: d2e379614dcb38f4f326fbb6b68791cd05f98914
2019-10-01 00:31:27 +00:00