Commit Graph

119 Commits

Author SHA1 Message Date
Egor.Eliseev
9bf5511829 PY-35986 Allow a user to run doctests with pytest
Fix rerunning failed tests for all Doctest.
Do 'Doctest via pytest' option be available not only if a file/fun/class starts with `test_`.


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

GitOrigin-RevId: c1e1fda5f66d1e213f34a057175d8e8986a46647
2024-04-13 17:27:10 +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
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
9891e44aeb PY-38477: Use quotes around the -k.
For cases like -k `spam not eggs` we need to add quotes.

GitOrigin-RevId: baa135e8cdd0f1a1e019406c0581ea6a8a86e1de
2021-09-17 14:51:07 +00:00
Ilya.Kazakevich
76a3c98f74 PY-46408: Support tests in `__init__.py`
``spam.Class`` may be class in ``spam/__init__.py``
See PyQNameResolveAndSplitUtils.kt

GitOrigin-RevId: a7ec7ddc4c3fa4e6140417c852c385a41be59695
2021-09-16 20:47:51 +00:00
Ilya.Kazakevich
05127f6e7d PY-49932: resolve elements with same names in tests: support case when folder and file have same name.
GitOrigin-RevId: 090a86cd58c51636f0a3fb39220cc55e0b64ed98
2021-09-13 16:25:19 +00:00
Ilya.Kazakevich
3e0f3fb205 PY-49932: resolve elements with same names in tests
GitOrigin-RevId: a8b0bcd76c92f12372e2b34dc467396423495246
2021-09-03 19:16:00 +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
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
fcc6842272 PY-33661: Rerun failed pytests along with additional arguments
GitOrigin-RevId: 6c50b80a0c2ed5fff62bf5ce969db6f09f04c2a9
2020-07-22 13:46:13 +00:00
Ilya.Kazakevich
6feb35abfb tests for unittest2 removed (not used anymore)
GitOrigin-RevId: 91bb6d580e7527ab69216f1ae4143be065d5bbc2
2019-12-11 13:38:19 +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
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
Rustam Vishnyakov
123242c4b2 EditorConfig documentation test
GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
2019-06-16 04:03:21 +03:00
Egor Zhdan
c1813cfb52 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-16 04:02:08 +03:00
Anna Kozlova
91f7445298 constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)
GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
2019-06-13 03:15:49 +03:00
Egor Zhdan
39d2d77155 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-13 03:14:35 +03:00
Aleksey Pivovarov
322db66a12 Recover after problematic merge
This commit reverts 65a557bb38f6ac03afa9aabaf02cb8d99fc68a91
                    3f5cfd958d9b6b54393c15983ac94f519c37fe61

GitOrigin-RevId: 8fb8ccbb17d0e217a83f265c185a943b0f5a7ed6
2019-05-03 01:52:21 +03:00
Nicolay Mitropolsky
9b850726ee [uast-groovy] UInjectionHost support
GitOrigin-RevId: 49ec454d1831796fa63b77fdc965f61985bf877e
2019-05-03 01:47:46 +03:00
Vladimir Plyashkun
c33e69a545 CPP-16098 - Lags during inplace rename typing
- reverted some of the changes

GitOrigin-RevId: c7c07b80a76c29794ef31e0e916e62f7f302917a
2019-05-03 01:47:14 +03:00
Leonid Bushuev
34be4bbf7d Apply the change from Develar: cleanup - specify UTF_8 charset explicitly
GitOrigin-RevId: 3f5cfd958d9b6b54393c15983ac94f519c37fe61
2019-05-03 01:46:11 +03:00
Vladimir Plyashkun
61a3e18b78 Merge branch 'master' into vplyashkun/inplace_rename_lags
GitOrigin-RevId: aaecc2a32e4e42de827efb45b8df733874a722e4
2019-05-03 01:41:29 +03:00
Leonid Bushuev
970dc0fe32 Remove unnecessary downcasting
GitOrigin-RevId: b91110977db6e5b08d9f4aaffa8496d305d698e2
2019-05-03 01:40:23 +03:00
Vladimir Plyashkun
2d9369d983 CPP-16098 - Lags during inplace rename typing
- changed behaviour in safe way by introducing new method to check that particular expression does not depend
  on committed PSI

GitOrigin-RevId: f5ec732613cdafdcef8a1d48eb8d04135c634047
2019-05-03 01:39:50 +03:00
Leonid Bushuev
338ad6db56 SQL code style per dialect: UI: fix indent editor
GitOrigin-RevId: 3cb00f5c500523717c42f404b2f38fd1822d6db0
2019-05-03 01:39:18 +03:00
Vladimir Plyashkun
e3ca319824 CPP-16098 - Lags during inplace rename typing
- call `commitDocument` explicitly in cases when `calculateQuickResult` can redirect it's calculation to heavy `calculateResult`

GitOrigin-RevId: 41f0c47c57f4528d7d7a25208024ec28bb8c2e12
2019-05-03 01:38:12 +03:00
Leonid Bushuev
dc1a52762e SQL code style per dialect: UI
GitOrigin-RevId: 9b1b3e745d4c8acef5a4a1018714e004e5423519
2019-05-03 01:37:38 +03:00
Vladimir Plyashkun
d712ac9901 CPP-16098 - Lags during inplace rename typing
- removed `commitDocument` call when `isQuick` argument is passed
- pass `element` or `null` to `equalsToText` call (since there is not real need to take it for text comparison)

GitOrigin-RevId: 27c5e1a2f484fc56d41dfd210832ae94c9a9b7ab
2019-05-03 01:37:04 +03:00
Leonid Bushuev
9f35a30458 SQL code style per dialect: UI
GitOrigin-RevId: 72cca4d6a23a5e2aa2089c03932ab2e9d08bfa48
2019-05-03 01:36:24 +03:00
Ilya.Kazakevich
6eceabff48 PY-35394: Don't break when setupClass reported several times.
With xdist, setupClass may be reported several times (one for each test). Next report leads to error since it is already
reported as closed.

We ignore setup methods: there is no sane place to display them in the test tree, anyway.

GitOrigin-RevId: 3c7bcf2f3942e78fcbfba5fb0cae1cbdb2c92730
2019-04-28 14:49:43 +03:00
Ilya.Kazakevich
01503a773f test not only leaf, but also branch status 2018-12-14 01:01:46 +03:00
Ilya.Kazakevich
9095682ef3 PY-32694: Support cases when different exception it thrown from trial
.py files copied from teamcity-messages
2018-12-07 00:11:24 +03:00
Ilya.Kazakevich
6f2aff6d2a test fix (yield is not supported by pytest anymore) 2018-11-28 01:50:50 +03:00
Ilya.Kazakevich
c55ec254e9 PY-31827: Sync with TC messages, do not throw exception if test name changed in the middle of the test 2018-10-31 00:50:06 +03:00
Ilya.Kazakevich
9449d7b336 PY-32431: use --last-failed + same arguments to rerun py.test
py.test reruns failed tests using its own machinery, we only need to provide same arguments. No need to modify anything else
2018-10-30 15:29:10 +03:00
Ilya.Kazakevich
63424abd68 PY-31953: Sync with runners: Do not provide class name for -k, only test name
-k "Class.method" does not work, while -k "method" does.
2018-10-26 02:52:29 +03:00
Ilya.Kazakevich
5e62b87288 test fix 2018-09-06 21:15:58 +03:00
Ilya.Kazakevich
4020d3b5f8 PY-25260: test added 2018-08-29 23:36:35 +03:00
Ilya.Kazakevich
d48ce2af51 PY-27267: swap diff in pytest (Sync tcmessages and add test)
Actual and expected are in wrong order.
Fixed on tcmessages side, test added.

Use swapdiff in pytest.ini to switch it back
2018-08-24 17:56:25 +03:00
Ilya.Kazakevich
9a82e20592 PY-27636: Add cwd to pythonpath's head instead of tail
current workdir must be inserted at position 0, not at
the last position because local files (like "test.py") must have priority over site-lib
2018-04-04 23:57:06 +03:00
Ilya.Kazakevich
519cd800c8 PY-28893: Sync with teamcity-messages
+test added

Convert objects and message in diff to string
2018-04-03 02:27:23 +03:00
Ilya.Kazakevich
b6940f6975 PY-29163: Create different config. if different files are used.
Assume you have two elements with same name but in different folders.
Targets are same but resolved to different elements because of
different working directories.

We now check if configuration's target resolved to same file
before reusing it.
2018-03-29 22:04:39 +03:00
Ilya.Kazakevich
c548f27e83 Test configuration deserialization 2018-01-30 23:46:13 +03:00
Ilya.Kazakevich
41cb5ed10e PY-27286: Sync with teamcity-messages + test 2017-12-06 18:33:42 +03:00
Ilya.Kazakevich
3a63ae3f23 PY-26432: assertEquals should not break subtests
Fixed on Leonid's site
2017-10-11 18:50:24 +03:00
Ilya.Kazakevich
0be23bc144 PY-26102: Suggest test runner for any file starting with "test_"
Any file that starts with "test_" may be used as pytest/nosetest target
regardless its content.
Unittest is skipped because of "testCaseClassRequired".
2017-09-20 23:54:32 +03:00
Ilya.Kazakevich
897351156c PY-25664: Search through list of all test methods, don't stop on first
Buggy logic went through list of methods failing on first that does
not start with 'test'.

It is now checks all methods.
2017-08-16 17:50:19 +03:00
Ilya.Kazakevich
e359fbe832 PY-2410: Support twisted.trial
Trial is test framework for Twisted much like unittests.
It is fully supported on Leonid side, we only need to create wrappers.

There were too many places with framework naming code making
it pretty hard to support new frameworks.

It is now unified. Any service (except framework-specific) should work
via PyTestFrameworkService to obtain list of frameworks and its
2017-07-24 18:26:39 +03:00
Ilya.Kazakevich
684449b5f0 PY-25271: Do not provide pattern if checkbox disabled 2017-07-24 18:17:23 +03:00
Ilya.Kazakevich
946dd6d5ae PY-24619: emulate qname for files with dashes to support them in tests
When user clicks on some element PyCharm gets its qname and generates
test target based on it. But user may use file with dashes.
There is no qName in this case, but all test runners support such targets.
So we emulate it in "getEmulatedQNameParts"
2017-07-11 00:55:14 +03:00