Commit Graph

477 Commits

Author SHA1 Message Date
Bruno Oliveira c17d50829f
Add pyproject.toml support (#7247) 2020-06-08 10:03:10 -03:00
Bruno Oliveira be1a2e440e Merge pull request #7301 from pytest-dev/release-5.4.3
Prepare release 5.4.3
2020-06-02 14:19:18 -03:00
Bruno Oliveira f506682abe
Merge pull request #6919 from nicoddemus/backport-6914 2020-05-16 12:42:15 -03:00
Paweł Wilczyński dbfc629698 #7138 Docs improvement: Apply indirect on particular arguments 2020-05-11 13:26:16 +02:00
Ran Benita a718ad6363 Stop using Python's eval() for -m and -k
Previously, the expressions given to the `-m` and `-k` options were
evaluated with `eval`. This causes a few issues:

- Python keywords cannot be used.

- Constants like numbers, None, True, False are not handled correctly.

- Various syntax like numeric operators and `X if Y else Z` is supported
  unintentionally.

- `eval()` is somewhat dangerous for arbitrary input.

- Can fail in many ways so requires `except Exception`.

The format we want to support is quite simple, so change to a custom
parser. This fixes the issues above, and gives us full control of the
format, so can be documented comprehensively and even be extended in the
future if we wish.
2020-05-01 12:59:06 +03:00
Alfredo Deza 7d75762de6 Do not use automatic title in fixture reference
It creates odd wording otherwise. Keep the reference, update the title
using Sphinx notation.
2020-04-01 09:55:30 -04:00
Ran Benita a785754523 Change EnvironmentError, IOError to OSError - they are aliases
Since Python 3.3, these are aliases for OSError:
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
2020-03-27 18:40:23 +03:00
Daniel Hahler aae0579bcd
doc: use `envvar` directive for environment variables (#6874)
This changes the link anchors in "reference.html", from e.g.
`reference.html#pytest-current-test` to
`reference.html#envvar-PYTEST_CURRENT_TEST`, but I think that is OK, and
not worth adding labels for the old anchors.
2020-03-27 02:40:25 +01:00
Daniel Hahler 327ec54248
Doc fixes (#6861) 2020-03-27 02:22:03 +01:00
Bruno Oliveira 010e711971 Merge pull request #6914 from nicoddemus/revert-6330
Revert "[parametrize] enforce explicit argnames declaration (#6330)"
2020-03-13 10:49:48 -03:00
pytest bot c9fd1bdbd6 Preparing release version 5.4.0 2020-03-12 14:14:35 +00:00
Ronny Pfannschmidt 378a75ddf6 run and fix tox -e regen to prepare 5.4
* no longer trigger deprecation warnings when looking up fixtures
* fix missed imports in a test example
2020-03-11 22:25:51 +01:00
Daniel Hahler 620d457756 doc: add __tracebackhide__ label 2020-03-02 17:08:37 +01:00
Bruno Oliveira e6ea9edffe
Merge pull request #6673 from sscherfke/features
Reverse / fix meaning of "+/-" in error diffs
2020-02-12 15:05:38 -03:00
Stefan Scherfke d59adc61f9 Reverse / fix meaning of "+/-" in error diffs
The convention is "assert result is expected".  Pytest's error diffs now
reflect this. "-" means that sth. expected is missing in the result and
"+" means that there are unexpected extras in the result.

Fixes: #3333
2020-02-10 21:12:37 +01:00
Vladyslav Rachek 9e262038c8
[parametrize] enforce explicit argnames declaration (#6330)
Every argname used in `parametrize` either must
be declared explicitly in the python test function, or via
`indirect` list

Fix #5712
2020-02-06 20:20:25 -03:00
Daniel Hahler b5b6e051ed Merge master into features 2020-01-30 02:29:02 +01:00
sdementen d848a20563 Extend the incremental marker for parametrize
The incremental marker is adapted to handle properly test classes with parametrize defined at class level.

Fix #3125
2020-01-29 08:25:17 -03:00
Daniel Hahler 09bdbffbde Merge master into features
Conflicts:
	src/_pytest/_code/code.py
	src/_pytest/main.py
2020-01-24 23:44:50 +01:00
Daniel Hahler b63cb18776 doc: remove costlysetup example
It is not included with docs, and
`example/costlysetup/sub_a/test_quick.py::test_quick` sleeps for 5s,
slowing down `doctesting` unnecessarily.
2020-01-23 12:23:30 +01:00
Bruno Oliveira 93b74d28d2 Merge remote-tracking branch 'upstream/master' into mm
Conflicts:
 * 	src/_pytest/_code/code.py
 * 	src/_pytest/main.py
 * 	testing/python/metafunc.py
 * 	testing/test_parseopt.py
 * 	testing/test_pytester.py
2020-01-22 11:03:45 -03:00
Bruno Oliveira 6a26ac4125 Preparing release version 5.3.4 2020-01-20 13:53:31 -03:00
Bruno Oliveira 56dc301c50 Preparing release version 5.3.3 2020-01-16 18:55:41 -05:00
Bruno Oliveira 853889e5db Merge remote-tracking branch 'upstream/master' into mm 2019-12-14 10:45:44 -03:00
Bruno Oliveira 10fcac7f90 Preparing release version 5.3.2 2019-12-13 08:51:15 -03:00
Christoph Bülter 623b3982b0
Update doc/en/example/markers.rst
Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
2019-12-05 16:59:08 +01:00
Christoph Buelter ac5929eef3 Update docs about case-insensitive expression matching 2019-12-05 14:13:22 +01:00
Bruno Oliveira 59f95b7f59 Merge remote-tracking branch 'upstream/master' into mm 2019-12-03 11:07:34 -03:00
Ran Benita d2d7b97a70 Remove outdated py2py3 example 2019-12-02 21:16:15 +02:00
Bruno Oliveira 05008f6b55 Preparing release version 5.3.1 2019-11-25 14:32:37 -03:00
Ronny Pfannschmidt 15ffe63204 update doc examples **untested** 2019-11-23 21:54:11 +01:00
Bruno Oliveira 4b16b93cf5 Preparing release version 5.3.0 2019-11-19 12:43:51 -03:00
Anthony Sottile c9a96cdee8 Preparing release version 5.2.4 2019-11-15 13:26:56 -08:00
Bruno Oliveira e856638ba0
Preparing release version 5.2.3 (#6190)
Preparing release version 5.2.3
2019-11-14 18:17:28 -03:00
Michael Shields bd68c2a3dc
Update advice about _called_from_test.
Instead of giving an example of using sys and then, at the end,
advising not to use sys, just give a correct example. This is
especially helpful since mypy 0.740 has started (correctly) complaining
about sys._called_from_pytest not being present.
2019-11-14 19:44:27 +00:00
Bruno Oliveira 5e8c47faad Preparing release version 5.2.3 2019-11-14 11:12:06 -03:00
Albert Tugushev 18786992bb Update doc to use contextlib2.nullcontext
nullcontext has been backported in contextlib2==0.6.0
2019-10-19 15:09:37 +07:00
Bruno Oliveira 068ef90b92 Preparing release version 5.2.0 2019-09-28 21:18:37 -04:00
Daniel Hahler 409cc2946a Merge master into features 2019-09-21 16:22:48 +02:00
Bruno Oliveira 1a9f4a51cb Preparing release version 5.1.3 2019-09-18 10:11:59 -03:00
Bruno Oliveira 6918d07560 Merge remote-tracking branch 'upstream/features' into aklajnert/1682-dynamic-scope 2019-09-18 07:44:18 -03:00
aklajnert 10bf6aac76 Implemented the dynamic scope feature. 2019-08-31 18:12:24 +02:00
Bruno Oliveira e56544cb58 Preparing release version 5.1.2 2019-08-30 12:43:47 -03:00
Anthony Sottile b135f5af8d Preparing release version 5.1.1 2019-08-20 11:30:36 -07:00
Bruno Oliveira eaf7ce9a99 Preparing release version 5.1.0 2019-08-15 20:00:09 -04:00
mei-li f4a84a8dfd reword a parametrize example sentence 2019-08-15 18:12:18 +02:00
boris 3eb4973065 remove %s formatting from docs 2019-08-12 00:09:53 -06:00
boris 7560a7b808 trivial doc change 2019-08-07 21:49:30 -06:00
boris 78de9d4677 replace implicit code tag with colon .replace("::\n\n.. code-block", ":\n\n.. code-block") 2019-08-06 16:20:06 -07:00
boris 23a0b532db Revert "remove implicit code tags .replace("::\n\n.. code-block", "\n\n.. code-block")"
This reverts commit 9fce0bdd88.
2019-08-06 16:18:06 -07:00
boris 9fce0bdd88 remove implicit code tags .replace("::\n\n.. code-block", "\n\n.. code-block") 2019-08-06 15:46:57 -07:00
boris 5f95dce956 ran blacken-docs 2019-08-06 13:34:58 -07:00
boris 75d0b899bb ran pyupgrade-docs again 2019-08-06 13:33:21 -07:00
boris 7f90e74e02 label code blocks 2019-08-06 13:25:54 -07:00
boris cf7761f91f ran pyupgrade-docs 2019-08-06 12:40:27 -07:00
Xixi Zhao 2959fb3198
Doc fix: remove redundant parentheses. 2019-07-30 16:18:22 +08:00
Bruno Oliveira f163b37f6a Run regen 2019-07-23 10:00:35 -04:00
Wojtek Erbetowski d23fbab188 Add autouse fixture order information (#3404).
A case with a fixture use both as an autouse and explititly
was raised. This case sounds too narrow to add to documentation
(and could be misleading for people learning pytest with explicitely
using an autouse fixture). At the same time there was no documentation
on the autouse vs regular fixture order, therefore this commit adds
such an information. Code sample grew and it was extracted to the file.
2019-07-13 11:43:47 +02:00
Bruno Oliveira bb29f31d22 Preparing release version 5.0.1 2019-07-04 20:01:16 -04:00
Michael Moore 1b0e8d73d5 Substituted 'yml' to '.yaml' in relevant files 2019-07-02 23:49:06 -07:00
Anthony Sottile 58bfc7736f Use shutil.which to avoid distutils+imp warning 2019-06-28 14:44:49 -07:00
Anthony Sottile 55d2fe076f Use importlib instead of imp in demo 2019-06-28 14:40:10 -07:00
Anthony Sottile fd2f320485 Preparing release version 5.0.0 2019-06-28 14:39:53 -07:00
Ralph Giles 918268774b
Add `slow` marker in run/skip option example.
The example implementation of a `--runslow` option results in
a `PytestUnknownMarkWarning`. Include registering the custom
mark in the example, based on the documentation in markers.rst.
2019-06-06 10:15:43 -07:00
Anthony Sottile 9657166a22 Merge pull request #5379 from asottile/release-4.6.2
Preparing release version 4.6.2
2019-06-03 12:19:42 -07:00
Anthony Sottile a91fe1fedd pre-commit run pyupgrade --all-files 2019-06-03 12:08:02 -03:00
Anthony Sottile 5034399d7a pre-commit run fix-encoding-pragma --all-files 2019-06-03 12:08:01 -03:00
Bruno Oliveira 28ac469eaa
Merge pull request #5367 from apollovy/master
Fix typo about interpreters count in doc/en/example/parametrize.html
2019-06-02 20:43:53 -03:00
Bruno Oliveira 5999782768 Use python 3 interpreters in example 2019-06-02 19:20:00 -03:00
Bruno Oliveira 6e68532bb3
Merge pull request #5362 from asottile/release-4.6.1 (#5365)
Merge pull request #5362 from asottile/release-4.6.1
2019-06-02 19:17:29 -03:00
Yuri Apollov 5c016d1021 Fix typo about interpreters count in doc/en/example/parametrize.html 2019-06-02 23:57:22 +03:00
Anthony Sottile 642ef6dc1b Merge pull request #5362 from asottile/release-4.6.1
Preparing release version 4.6.1
2019-06-02 11:47:26 -07:00
Bruno Oliveira 4d49ba6529 Drop Python 2.7 and 3.4 support
* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs

Related to #5275
2019-06-02 14:39:11 -03:00
Anthony Sottile e7cd00ac92 Preparing release version 4.6.0 2019-05-31 23:12:57 -07:00
Bruno Oliveira 66f20b6f5e
Fix invalid Python file encoding "utf8" (#5252)
Fix invalid Python file encoding "utf8"
2019-05-23 20:24:23 -03:00
Bruno Oliveira e44a2ef653 Apply suggestions from code review
Co-Authored-By: Daniel Hahler <github@thequod.de>
2019-05-15 20:45:22 -03:00
Bruno Oliveira c6e3ff3ce5 Mention "-m" in the main mark docs 2019-05-15 20:45:22 -03:00
Anthony Sottile dc75b6af47 Use fix-encoding-pragma pre-commit hook 2019-05-14 15:56:31 -07:00
Bruno Oliveira 63fe547d9f Preparing release version 4.5.0 2019-05-11 16:35:32 +00:00
Bruno Oliveira 465b2d998a
Further "unknown marks warning" improvements (#5178)
Further "unknown marks warning" improvements
2019-05-11 13:28:10 -03:00
Bruno Oliveira 685ca96c71 Change ``--strict`` to ``--strict-markers``, preserving the old one
Fix #5023
2019-05-09 19:36:38 -03:00
Bruno Oliveira ccf6c3cb46 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2019-05-09 19:22:40 -03:00
Bruno Oliveira 5d7686951c Run regendoc 2019-05-08 21:50:08 +00:00
Bruno Oliveira 3ac43314ee Preparing release version 4.4.2 2019-05-08 12:46:14 -03:00
Anthony Sottile d1a48ad68f Use exec directly 2019-05-06 23:07:39 -07:00
Bruno Oliveira 772a4a5cf3
Remove all version references to obsolete pytest versions (#5184)
Remove all version references to obsolete pytest versions
2019-04-29 08:02:32 -03:00
Bruno Oliveira 9c5da9c0d1 Remove all version references to obsolete pytest versions
Remove version references to pytest 2 and 3.

Just like Python 3 no longer has references to Python 2, I think
we should follow the same approach in pytest.
2019-04-28 12:37:58 -03:00
Bruno Oliveira 50937fe622 Add note about pytest_load_initial_conftests working only from plugins
Fix #5175
2019-04-27 10:12:27 -03:00
Bruno Oliveira 006dc30476 Preparing release version 4.4.1 2019-04-15 14:24:17 +00:00
Anthony Sottile 8449294e5d blacken-docs more code samples in docs 2019-04-12 04:50:26 -07:00
Daniel Hahler 1f66e3b0d0 docs: tbreportdemo: remove obsolete comment 2019-04-11 11:39:23 +02:00
Daniel Hahler befc8a3f10 Update via https://github.com/pytest-dev/regendoc/pull/8 2019-04-03 22:08:44 +02:00
Bruno Oliveira 8881b201aa Preparing release version 4.4.0 2019-03-29 20:49:18 +00:00
Bruno Oliveira 492cc4219c Prepare release 4.3.1 2019-03-11 12:59:54 -03:00
Zac Hatfield-Dodds c8a87e48ab
Merge pull request #4783 from gyermolenko/fix_syntax_highlighting_for_two_rst_docs
Fix sphinx code-block types (syntax highlighting) in two docs
2019-02-20 06:31:10 +11:00
Daniel Hahler ff015f6308 Fix docs (tox -e regen, plus pre-commit) 2019-02-18 18:46:03 +01:00
Grygorii Iermolenko 6e1ee0802f Fix sphinx code-block types for remaining rst docs 2019-02-15 15:10:37 +02:00
Grygorii Iermolenko 5cf58a9ae9 Revert '$' changes to not trigger regendoc 2019-02-15 14:09:37 +02:00
Grygorii Iermolenko 799bcccd1b Fix sphinx code-block types (syntax highlighting) in two docs 2019-02-13 17:08:49 +02:00
Daniel Hahler fc8800c71f
Merge pull request #4722 from fetzerch/ignore_wildcards
Add ability to use globs when using --ignore
2019-02-09 00:11:04 +01:00