pytest2/testing
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
..
code Fix TerminalRepr instances to be hashable (#6988) 2020-04-03 00:56:53 +02:00
example_scripts Merge pull request #6285 from earonesty/patch-1 2020-04-10 07:58:58 +02:00
examples pre-commit run fix-encoding-pragma --all-files 2019-06-03 12:08:01 -03:00
freeze Replace a few outdated references to py.test with pytest 2019-10-26 16:28:17 +03:00
io _pformat_dispatch: pass through args (#6715) 2020-02-12 16:07:57 +01:00
logging pre-commit: update pyupgrade 1.18.0 -> 2.2.1 2020-04-24 21:57:38 +03:00
python fixtures: deprecate pytest._fillfuncargs function 2020-04-24 18:54:46 +03:00
acceptance_test.py pre-commit: update pyupgrade 1.18.0 -> 2.2.1 2020-04-24 21:57:38 +03:00
conftest.py Assorted improvements following up #6658 2020-02-20 18:51:41 -03:00
deprecated_test.py fixtures: deprecate pytest._fillfuncargs function 2020-04-24 18:54:46 +03:00
test_argcomplete.py Change EnvironmentError, IOError to OSError - they are aliases 2020-03-27 18:40:23 +03:00
test_assertion.py Remove some no-longer-needed compat code in test_assertion 2020-04-08 21:35:42 +03:00
test_assertrewrite.py Remove broken _reprcompare disabling fixture in test_assertrewrite.py 2020-04-09 10:47:45 +03:00
test_cacheprovider.py Merge pull request #7130 from bluetech/cacheprovider-nf-set 2020-04-29 17:28:20 +03:00
test_capture.py pre-commit: update pyupgrade 1.18.0 -> 2.2.1 2020-04-24 21:57:38 +03:00
test_collection.py tests: fix TypeErrors (#7038) 2020-04-08 18:11:04 +02:00
test_compat.py tests: cover safe_getattr 2020-01-15 11:20:00 +01:00
test_config.py pre-commit run --all-files 2020-03-07 23:47:55 +01:00
test_conftest.py Move ExitCode's definition from _pytest.main to _pytest.config 2020-02-10 23:55:06 +02:00
test_debugging.py Merge remote-tracking branch 'upstream/master' into mm 2020-01-22 11:03:45 -03:00
test_doctest.py doctest: strip newlines with unexpected exceptions (#6801) 2020-02-24 15:18:08 +01:00
test_entry_points.py Replace importlib_metadata with importlib.metadata on Python 3.8+ 2019-07-04 15:00:10 +02:00
test_error_diffs.py Reverse / fix meaning of "+/-" in error diffs 2020-02-10 21:12:37 +01:00
test_faulthandler.py Skip flaky test test_faulthandler.py::test_timeout[True] 2020-04-09 17:23:54 +03:00
test_helpconfig.py Merge remote-tracking branch 'upstream/master' into mm 2020-02-11 19:22:28 -03:00
test_junitxml.py Remove Python 2 compat code in test_juintxml.py 2020-04-09 17:33:55 +03:00
test_main.py Merge remote-tracking branch 'upstream/master' into mm 2020-02-11 19:22:28 -03:00
test_mark.py Stop using Python's eval() for -m and -k 2020-05-01 12:59:06 +03:00
test_mark_expression.py Stop using Python's eval() for -m and -k 2020-05-01 12:59:06 +03:00
test_meta.py Fix test_no_warnings to handle e.g. `_pytest.async` (#7044) 2020-04-09 16:56:01 +02:00
test_monkeypatch.py Remove Python 2 compat check in test_monkeypatch.py 2020-04-09 17:11:18 +03:00
test_nodes.py fix #6341 - disallow session/config in Node.from_parent 2020-01-15 13:00:46 +01:00
test_nose.py Node.location: handle str with _node_location_to_relpath 2020-01-23 10:45:31 +01:00
test_parseopt.py Merge remote-tracking branch 'upstream/master' into mm 2020-02-11 19:22:28 -03:00
test_pastebin.py Fix "lexer" being used when uploading to bpaste.net 2019-08-30 15:34:03 -04:00
test_pathlib.py Switch from deprecated imp to importlib 2019-06-24 09:48:38 -07:00
test_pluginmanager.py Move ExitCode's definition from _pytest.main to _pytest.config 2020-02-10 23:55:06 +02:00
test_pytester.py Fix usage of pytester with doctests (#6802) 2020-03-04 05:33:50 +01:00
test_recwarn.py Use a hack to make typing of pytest.fail.Exception & co work 2020-02-18 23:17:27 +02:00
test_reports.py Fix tests: use explicit syspathinsert where tests might hang (#7008) 2020-04-04 12:33:15 +02:00
test_resultlog.py Handle unknown stats in pytest_report_teststatus hook 2020-03-12 20:52:22 -03:00
test_runner.py Remove TestExecutionForked - xdist.boxed has gone since long (#7021) 2020-04-07 08:07:20 +02:00
test_runner_xunit.py Fix plurality mismatch for and in pytest terminal summary 2019-10-27 15:16:24 +00:00
test_session.py Simplify test_rootdir_wrong_option_arg (#6812) 2020-02-28 18:38:07 +01:00
test_setuponly.py Move ExitCode's definition from _pytest.main to _pytest.config 2020-02-10 23:55:06 +02:00
test_setupplan.py Merge remote-tracking branch 'upstream/master' into release-5.3.0 2019-11-19 12:42:11 -03:00
test_skipping.py Issue 4677 - always relative path in skip report (#6953) 2020-04-17 08:28:36 +03:00
test_stepwise.py tests: test_xfail_handling: use sys.dont_write_bytecode 2020-01-11 23:05:12 +01:00
test_store.py Add setdefault() method to Store 2020-03-06 11:42:20 +02:00
test_terminal.py Issue 4677 - always relative path in skip report (#6953) 2020-04-17 08:28:36 +03:00
test_tmpdir.py Cleanup/move imports with tmpdir tests (#7015) 2020-04-04 14:25:34 +02:00
test_unittest.py prepare tests and disable warnings for asyncio unittest cases 2020-03-30 21:55:12 +02:00
test_warning_types.py Make pytest warnings show as from 'pytest' module instead of '_pytest.warning_types' 2019-06-15 11:48:34 -03:00
test_warnings.py Fix linting 2020-03-27 09:54:20 -03:00