Skip to content

Commit bba09f8

Browse files
committed
Remove deprecated cmd options Fixes pytest-dev#1657
1 parent 0c63762 commit bba09f8

19 files changed

+25
-397
lines changed

CHANGELOG.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@
3838

3939
*
4040

41-
*
41+
**Incompatible changes**
42+
43+
* Removing the following deprecated commandline options
44+
45+
* genscript
46+
* no-assert
47+
* nomagic
48+
* report
49+
50+
Thanks to `@RedBeardCode`_ for the PR(`#1664`_)
51+
52+
4253

4354
.. _#1580: https://github.com/pytest-dev/pytest/pull/1580
4455
.. _#1605: https://github.com/pytest-dev/pytest/issues/1605
@@ -47,6 +58,7 @@
4758
.. _#1553: https://github.com/pytest-dev/pytest/issues/1553
4859
.. _#1626: https://github.com/pytest-dev/pytest/pull/1626
4960
.. _#1503: https://github.com/pytest-dev/pytest/issues/1503
61+
.. _#1664: https://github.com/pytest-dev/pytest/pull/1664
5062

5163
.. _@graingert: https://github.com/graingert
5264
.. _@taschini: https://github.com/taschini

_pytest/assertion/__init__.py

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

3627

3728
class AssertionState:
@@ -44,8 +35,6 @@ def __init__(self, config, mode):
4435

4536
def pytest_configure(config):
4637
mode = config.getvalue("assertmode")
47-
if config.getvalue("noassert") or config.getvalue("nomagic"):
48-
mode = "plain"
4938
if mode == "rewrite":
5039
try:
5140
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").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
@@ -287,3 +287,6 @@ For further information, Benjamin Peterson wrote up `Behind the scenes of pytest
287287
.. versionchanged:: 2.1
288288
Introduce the ``--assert`` option. Deprecate ``--no-assert`` and
289289
``--nomagic``.
290+
291+
.. versionchanged:: 3.0
292+
Removes the ``--no-assert`` and``--nomagic`` options.

doc/en/getting-started.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ 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
@@ -227,11 +227,6 @@ py.test not found on Windows despite installation?
227227

228228
.. _`Jython does not create command line launchers`: http://bugs.jython.org/issue1491
229229

230-
- **Jython2.5.1 on Windows XP**: `Jython does not create command line launchers`_
231-
so ``py.test`` will not work correctly. You may install py.test on
232-
CPython and type ``py.test --genscript=mytest`` and then use
233-
``jython mytest`` to run your tests with Jython using ``pytest``.
234-
235230
:ref:`examples` for more complex examples
236231

237232
.. include:: links.inc

doc/en/goodpractices.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -243,38 +243,5 @@ using the ``--pytest-args`` or ``-a`` command-line option. For example::
243243
is equivalent to running ``py.test --durations=5``.
244244

245245

246-
.. _standalone:
247-
.. _`genscript method`:
248-
249-
(deprecated) Create a pytest standalone script
250-
-----------------------------------------------
251-
252-
.. deprecated:: 2.8
253-
254-
.. note::
255-
256-
``genscript`` has been deprecated because:
257-
258-
* It cannot support plugins, rendering its usefulness extremely limited;
259-
* Tooling has become much better since ``genscript`` was introduced;
260-
* It is possible to build a zipped ``pytest`` application without the
261-
shortcomings above.
262-
263-
There's no planned version in which this command will be removed
264-
at the moment of this writing, but its use is discouraged for new
265-
applications.
266-
267-
If you are a maintainer or application developer and want people
268-
who don't deal with python much to easily run tests you may generate
269-
a standalone ``pytest`` script::
270-
271-
py.test --genscript=runtests.py
272-
273-
This generates a ``runtests.py`` script which is a fully functional basic
274-
``pytest`` script, running unchanged under Python2 and Python3.
275-
You can tell people to download the script and then e.g. run it like this::
276-
277-
python runtests.py
278-
279246

280247
.. include:: links.inc

doc/en/plugins.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ in the `pytest repository <https://github.com/pytest-dev/pytest>`_.
138138
_pytest.capture
139139
_pytest.config
140140
_pytest.doctest
141-
_pytest.genscript
142141
_pytest.helpconfig
143142
_pytest.junitxml
144143
_pytest.mark

0 commit comments

Comments
 (0)