Commit Graph

146 Commits

Author SHA1 Message Date
Anthony Sottile c58b0fb4ac Use ATTRS_EQ_FIELD for attrs 19.2 compat 2019-10-05 18:16:35 -07:00
Hynek Schlawack a79acf279a Fix warnings with attrs 19.2 and fix object assertions
attrs 19.2 deprecated cmp in favor of the dataclass-ish eq/order duo.

This causes deprecation warnings that in turn break some of the cool new deep
object comparisons. Since we at attrs expected this to be a problem, it shipped
with helpers to write backward and forward compatible code.

This PR uses that and avoids changed to minimal versions.
2019-10-01 20:47:59 +02:00
Daniel Hahler e5f4c47cd5 test_assertion: minor cleanup 2019-08-17 21:38:52 +02:00
Daniel Hahler 05bfe73cf9 Fix wrong location of assertion error with coverage.py
Reverts using-constant part from 39ba99613.

Fixes https://github.com/pytest-dev/pytest/issues/5754.
2019-08-17 21:34:13 +02:00
Miro Hrončok c54cbd63c8 Replace importlib_metadata with importlib.metadata on Python 3.8+
Fixes https://github.com/pytest-dev/pytest/issues/5537
2019-07-04 15:00:10 +02:00
Bruno Oliveira 3f2344e8f7 Show bytes ascii representation instead of numeric value 2019-06-25 20:40:25 -03:00
Daniel Hahler 8c7eb82363 Fix/improve comparison of byte strings
Fixes https://github.com/pytest-dev/pytest/issues/5260.
2019-06-25 20:15:45 -03:00
Anthony Sottile 4cd08f9b52 Switch from deprecated imp to importlib 2019-06-24 09:48:38 -07:00
Anthony Sottile be2be040f9 Clean up u' prefixes and py2 bytes conversions 2019-06-04 17:50:34 -07:00
Anthony Sottile 4df529e5b9 Clean up __future__ and coding: in tests 2019-06-03 12:08:02 -03:00
Anthony Sottile a91fe1fedd pre-commit run pyupgrade --all-files 2019-06-03 12:08:02 -03:00
Anthony Sottile 3f1ec520fc pre-commit run reorder-python-imports --all-files 2019-06-03 12:08:01 -03:00
Anthony Sottile 5034399d7a pre-commit run fix-encoding-pragma --all-files 2019-06-03 12:08:01 -03: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 13f02af97d Switch to importlib-metadata 2019-05-27 13:24:08 -07:00
Daniel Hahler ff428bfee1 tests: harden test_nonascii_text 2019-05-17 18:06:32 +02:00
Daniel Hahler 47d92a0d96 Add tests and improve messages 2019-04-04 17:53:39 +02:00
Daniel Hahler 0d00be4f4f Do not swallow outcomes.Exit in assertrepr_compare 2019-03-26 10:20:00 +01:00
Bruno Oliveira a68f4fd2b9 Fix test failures after pluggy 1.8 release
pluggy now calls iter_entry_points with different arguments, and tests
which mocked that call need to be updated accordingly.
2019-02-22 18:58:54 -03:00
Anthony Sottile ec5e279f93 Remove and ban use of py.builtin 2019-01-20 11:59:48 -08:00
Oscar Benjamin 85055a9efe Show full repr with assert a==b and -vv 2019-01-08 01:25:05 +00:00
Daniel Hahler 8e287c5c77 Merge master into features 2018-12-14 16:44:43 +01:00
Daniel Hahler 64ee1ee81b tests: fix tests that require PYTEST_DISABLE_PLUGIN_AUTOLOAD to be unset
Fix pytest's own tests with PYTEST_DISABLE_PLUGIN_AUTOLOAD=1.
2018-12-09 12:06:18 +01:00
Aly Sivji b83e97802e improve failure output 2018-11-13 09:37:02 -06:00
Aly Sivji 2bffd6829e Move dataclass tests for 3.7 to separate file 2018-11-12 15:36:16 -06:00
Aly Sivji 4e99c80425 have tests pass in python37; move to separate file 2018-11-12 11:24:15 -06:00
Aly Sivji 025d160dfc Update tests to pass in py27 2018-11-12 09:28:47 -06:00
Aly Sivji 1847cc7420 adding docs and cleaning up 2018-11-12 09:28:47 -06:00
Aly Sivji 1184db8273 cleaning up 2018-11-12 09:28:47 -06:00
Aly Sivji d42f1e87c3 Add tests for attrs and dataclasses 2018-11-12 09:28:47 -06:00
Anthony Sottile a4819844a4 Use unicode/bytes literals instead of calls 2018-11-04 17:43:24 -08:00
Anthony Sottile 2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Bruno Oliveira 9ae0a3cd85 Do not trigger warning about tuples being always True if the tuple has size != 2 2018-09-04 13:41:11 -03:00
Bruno Oliveira 78ac7d99f5 Deprecate Config.warn and Node.warn, replaced by standard warnings 2018-09-04 11:35:34 -03:00
Anthony Sottile dccac69d82 py.builtin.text -> six.text_type 2018-08-22 23:00:06 -07:00
Anthony Sottile 0fc4a806e5 py.builtins._totext -> string literals or six.text_type 2018-08-22 23:00:04 -07:00
Bruno Oliveira 011f88f7e7 Deprecate calling fixture functions directly
This will now issue a RemovedInPytest4Warning when the user calls
a fixture function directly, instead of requesting it from test
functions as is expected

Fix #3661
2018-07-26 19:58:42 -03:00
Anthony Sottile cbaa7dd56a Upgrade pre-commit hooks except pyupgrade 2018-06-26 06:35:27 -07:00
Anthony Sottile 3d0717813a bytes() is a builtin in python2.6+ 2018-06-03 11:54:36 -07:00
Ronny Pfannschmidt 703e4b11ba run black 2018-05-23 16:48:46 +02:00
Ronny Pfannschmidt 9aacb4635e run pyupgrade 2018-05-23 16:45:09 +02:00
Ville Skyttä aa51fcb2b6 Spelling and grammar fixes 2018-05-13 12:06:09 +02:00
Bruno Oliveira dca77b2273 Escape whitespace only strings when diffing them on failed assertions
Fix #3443
2018-05-03 20:38:00 -03:00
Bruno Oliveira 4678cbeb91 Merge remote-tracking branch 'upstream/features' 2017-11-27 19:37:58 -02:00
Daniel Hahler d5f038e29a Fix spelling: s/re-writ/rewrit/g
This also fixes "can not" to "cannot" in the "Module already imported so
cannot be rewritten" assertion error.
2017-11-26 20:46:06 +01:00
Bruno Oliveira f50ace7c0a Merge remote-tracking branch 'upstream/master' into release-3.3.0 2017-11-23 20:20:40 +00:00
Bruno Oliveira c8d52b633b Fix assertion rewrite to match module names correctly
Fix #2939
2017-11-21 23:06:47 -02:00
Bruno Oliveira dab889304e Implement progress percentage reporting while running tests
Fix #2657
2017-11-21 21:01:41 -02:00
Bruno Oliveira 03829fde8a Fix linting E741: ambiguous variable name 2017-11-04 13:59:10 -02:00
Andras Tim b840622819 Fixed E302 flake8 errors
expected 2 blank lines, found 0
2017-07-17 01:44:23 +02:00