Skip to content

Commit 0e2ebc9

Browse files
RedBeardCodenicoddemus
authored andcommitted
Remove deprecated cmd options
Fixes pytest-dev#1657
1 parent 68bed00 commit 0e2ebc9

19 files changed

+26
-431
lines changed

CHANGELOG.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,22 @@
1616

1717
*
1818

19+
**Incompatible changes**
20+
21+
* Removing the following deprecated commandline options
22+
23+
* genscript
24+
* no-assert
25+
* nomagic
26+
* report
27+
28+
Thanks to `@RedBeardCode`_ for the PR(`#1664`_)
29+
30+
1931
.. _#607: https://github.com/pytest-dev/pytest/issues/607
2032
.. _#1519: https://github.com/pytest-dev/pytest/pull/1519
33+
.. _#1664: https://github.com/pytest-dev/pytest/pull/1664
34+
2135

2236
2.10.0.dev1
2337
===========
@@ -146,7 +160,6 @@
146160
* Add proposal to docs for a new feature that enables users to combine multiple
147161
fixtures into one. Thanks to `@hpk42`_ and `@hackebrot`_.
148162

149-
*
150163

151164
.. _#1580: https://github.com/pytest-dev/pytest/pull/1580
152165
.. _#1605: https://github.com/pytest-dev/pytest/issues/1605

_pytest/assertion/__init__.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ def pytest_addoption(parser):
2525
'rewrite' (the default) rewrites assert
2626
statements in test modules on import to
2727
provide assert expression information. """)
28-
group.addoption('--no-assert',
29-
action="store_true",
30-
default=False,
31-
dest="noassert",
32-
help="DEPRECATED equivalent to --assert=plain")
33-
group.addoption('--nomagic', '--no-magic',
34-
action="store_true",
35-
default=False,
36-
help="DEPRECATED equivalent to --assert=plain")
3728

3829

3930
class AssertionState:
@@ -48,10 +39,6 @@ def __init__(self, config, mode):
4839
def pytest_load_initial_conftests(early_config, parser, args):
4940
ns, ns_unknown_args = parser.parse_known_and_unknown_args(args)
5041
mode = ns.assertmode
51-
no_assert = ns.noassert
52-
no_magic = ns.nomagic
53-
if no_assert or no_magic:
54-
mode = "plain"
5542
if mode == "rewrite":
5643
try:
5744
import ast # noqa

_pytest/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class UsageError(Exception):
6464

6565
default_plugins = (
6666
"mark main terminal runner python pdb unittest capture skipping "
67-
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion genscript "
67+
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
6868
"junitxml resultlog doctest cacheprovider setuponly setupplan").split()
6969

7070
builtin_plugins = set(default_plugins)

_pytest/genscript.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

_pytest/standalonetemplate.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

_pytest/terminal.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ def pytest_addoption(parser):
2727
group._addoption('-l', '--showlocals',
2828
action="store_true", dest="showlocals", default=False,
2929
help="show locals in tracebacks (disabled by default).")
30-
group._addoption('--report',
31-
action="store", dest="report", default=None, metavar="opts",
32-
help="(deprecated, use -r)")
3330
group._addoption('--tb', metavar="style",
3431
action="store", dest="tbstyle", default='auto',
3532
choices=['auto', 'long', 'short', 'no', 'line', 'native'],
@@ -54,17 +51,6 @@ def mywriter(tags, args):
5451

5552
def getreportopt(config):
5653
reportopts = ""
57-
optvalue = config.option.report
58-
if optvalue:
59-
py.builtin.print_("DEPRECATED: use -r instead of --report option.",
60-
file=sys.stderr)
61-
if optvalue:
62-
for setting in optvalue.split(","):
63-
setting = setting.strip()
64-
if setting == "skipped":
65-
reportopts += "s"
66-
elif setting == "xfailed":
67-
reportopts += "x"
6854
reportchars = config.option.reportchars
6955
if reportchars:
7056
for char in reportchars:

doc/en/assert.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,6 @@ For further information, Benjamin Peterson wrote up `Behind the scenes of pytest
314314
.. versionchanged:: 2.1
315315
Introduce the ``--assert`` option. Deprecate ``--no-assert`` and
316316
``--nomagic``.
317+
318+
.. versionchanged:: 3.0
319+
Removes the ``--no-assert`` and``--nomagic`` options.

doc/en/getting-started.rst

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -193,45 +193,9 @@ Where to go next
193193
Here are a few suggestions where to go next:
194194

195195
* :ref:`cmdline` for command line invocation examples
196-
* :ref:`good practices <goodpractices>` for virtualenv, test layout, genscript support
196+
* :ref:`good practices <goodpractices>` for virtualenv, test layout
197197
* :ref:`fixtures` for providing a functional baseline to your tests
198198
* :ref:`apiref` for documentation and examples on using ``pytest``
199199
* :ref:`plugins` managing and writing plugins
200200

201-
.. _`installation issues`:
202-
203-
Known Installation issues
204-
------------------------------
205-
206-
easy_install or pip not found?
207-
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
208-
209-
.. _`install pip`: http://www.pip-installer.org/en/latest/index.html
210-
211-
`Install pip`_ for a state of the art python package installer.
212-
213-
Install `setuptools`_ to get ``easy_install`` which allows to install
214-
``.egg`` binary format packages in addition to source-based ones.
215-
216-
pytest not found on Windows despite installation?
217-
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
218-
219-
.. _`Python for Windows`: http://www.imladris.com/Scripts/PythonForWindows.html
220-
221-
- **Windows**: If "easy_install" or "pytest" are not found
222-
you need to add the Python script path to your ``PATH``, see here:
223-
`Python for Windows`_. You may alternatively use an `ActivePython install`_
224-
which does this for you automatically.
225-
226-
.. _`ActivePython install`: http://www.activestate.com/activepython/downloads
227-
228-
.. _`Jython does not create command line launchers`: http://bugs.jython.org/issue1491
229-
230-
- **Jython2.5.1 on Windows XP**: `Jython does not create command line launchers`_
231-
so ``pytest`` will not work correctly. You may install pytest on
232-
CPython and type ``pytest --genscript=mytest`` and then use
233-
``jython mytest`` to run your tests with Jython using ``pytest``.
234-
235-
:ref:`examples` for more complex examples
236-
237201
.. include:: links.inc

0 commit comments

Comments
 (0)