Commit Graph

290 Commits

Author SHA1 Message Date
Florian Bruhin
8e5014fc0f tox: Update pytest to 2.8.7.
- use predictable object resolution for monkeypatch

- allow for double nodeids in junitxml,
  this was a regression failing plugins combinations like pytest-pep8 +
  pytest-flakes

- Workaround for exception that occurs in pyreadline when using ``--pdb`` with
  standard I/O capture enabled.

- Better error message in case the target of a ``monkeypatch`` call raises an
  ``ImportError``.

- monkeypatch calls (setattr, setenv, etc.) are now O(1).

- captured stdout and stderr are now properly displayed before entering pdb
  when ``--pdb`` is used instead of being thrown away.

- pytest warnings emitted during ``pytest_terminal_summary`` are now properly
  displayed.

- fixed internal UnicodeDecodeError when doctests contain unicode.

- Add captured stdout to jUnit XML report on setup error.
2016-01-25 06:11:09 +01:00
Florian Bruhin
e9662b71f0 Move pytest arguments to pytest.ini.
Closes #1260.
2016-01-24 21:10:22 +01:00
Florian Bruhin
95fe54f010 Avoid running coverage when it's unneeded.
Unfortunately running coverage means our tests need more than a minute longer
to run.

We still run it in the following scenarios:
    - Full 'tox' run
    - On Travis CI on Linux
    - On the buildbot on Archlinux

But not anymore in the following scenarios:
    - When running 'tox -e py35' (or py34)
    - On Travis CI on OS X
    - On AppVeyor
    - On the buildbot except on Archlinux
2016-01-24 20:17:28 +01:00
Florian Bruhin
90c34bce17 tox: Filter pytest 2.8.6 for requirements.io. 2016-01-24 18:32:24 +01:00
Florian Bruhin
fd12aaef5f tox: Update pytest-catchlog to 1.2.2.
- Fix unicode vs str compatibility issues between Python2 and Python3.
2016-01-24 16:56:12 +01:00
Florian Bruhin
e6d9799c4b Revert "tox: Update pytest to 2.8.6."
This reverts commit cf0e13d51a.
See https://github.com/pytest-dev/pytest/issues/1338
2016-01-24 16:54:49 +01:00
Florian Bruhin
cf0e13d51a tox: Update pytest to 2.8.6.
- allow for double nodeids in junitxml,
  this was a regression failing plugins combinations like pytest-pep8 +
  pytest-flakes

- Workaround for exception that occurs in pyreadline when using ``--pdb`` with
  standard I/O capture enabled.

- Better error message in case the target of a ``monkeypatch`` call raises an
  ``ImportError``.

- monkeypatch calls (setattr, setenv, etc.) are now O(1).

- captured stdout and stderr are now properly displayed before entering pdb
  when ``--pdb`` is used instead of being thrown away.

- pytest warnings emitted during ``pytest_terminal_summary`` are now properly
  displayed.

- fixed internal UnicodeDecodeError when doctests contain unicode.

- Add captured stdout to jUnit XML report on setup error.
2016-01-24 01:02:14 +01:00
Florian Bruhin
7fa0dc68bf flake8: Add flake8-pep3101 plugin.
Checks for old string formatting.
https://pypi.python.org/pypi/flake8-pep3101/
2016-01-22 19:40:10 +01:00
Florian Bruhin
7945e632ba flake8: Add flake8-mock plugin. 2016-01-22 19:17:55 +01:00
Florian Bruhin
dbdbc1d8db flake8: Add flake8-deprecated plugin.
Warns about deprecated method calls.
https://pypi.python.org/pypi/flake8-deprecated/
2016-01-22 19:13:23 +01:00
Florian Bruhin
f74d1f26c7 flake8: Add flake8-string-format plugin.
string format checker, plugin for flake8
https://pypi.python.org/pypi/flake8-string-format/
2016-01-22 19:00:29 +01:00
Florian Bruhin
8bdb1b6b14 flake8: Add flake8-copyright plugin.
Adds copyright checks to flake8
https://pypi.python.org/pypi/flake8-copyright/
2016-01-22 17:46:33 +01:00
Florian Bruhin
3a7ced5843 flake8: Add ebb-lint plugin.
lint for ensuring quality software
https://pypi.python.org/pypi/ebb-lint/
2016-01-22 17:33:58 +01:00
Florian Bruhin
58fb2826ee flake8: Add flake8-putty plugin.
Apply a bit of putty to flake8.
https://pypi.python.org/pypi/flake8-putty/
2016-01-22 17:33:58 +01:00
Florian Bruhin
fccde768ed flake8: Add pep8-naming plugin.
Check PEP-8 naming conventions, plugin for flake8
https://pypi.python.org/pypi/pep8-naming/
2016-01-22 17:33:58 +01:00
Florian Bruhin
7e3507aba1 flake8: Add flake8-debugger plugin.
flake8 debug statement checker
https://github.com/JBKahn/flake8-debugger
2016-01-22 17:33:58 +01:00
Florian Bruhin
1952e070fd Initial switch to flake8. 2016-01-22 17:33:58 +01:00
Florian Bruhin
a1eb26c042 tox: Don't install unneeded deps for tox -e mkvenv.
Fixes #1225.
2016-01-19 06:19:54 +01:00
Florian Bruhin
31af303d07 tox: Update pep8 to 1.7.
We're now ready for #1226, but this only updates pep8 for now.

Changes:

* Reverted the fix, "options passed on command line are only ones accepted"
feature. This has many unintended consequences in pep8 and flake8 and needs to
be reworked when I have more time.
* Added support for Python 3.5.
* Added support for multi-line config_file option parsing.
* Improved parameter parsing.

Bugs:

* Fixed BytesWarning on Python 3.
2016-01-18 07:40:42 +01:00
Florian Bruhin
e79e01fc97 tox: Update pylint/astroid to 1.5.4/1.4.4.
pylint:

* Merge StringMethodChecker with StringFormatChecker. This fixes a
  bug where disabling all the messages and enabling only a handful of
  messages from the StringFormatChecker would have resulted in no
  messages at all.

* Don't apply unneeded-not over sets.

astroid:

* unpack_infer raises InferenceError if it can't operate
  with the given sequences of nodes.

* Support accessing properties with super().

* Enforce strong updates per frames.

  When looking up a name in a scope, Scope.lookup will return
  only the values which will be reachable after execution, as seen
  in the following code:

       a = 1
       a = 2

  In this case it doesn't make sense to return two values, but
  only the last one.
2016-01-18 07:38:34 +01:00
Florian Bruhin
df98312f42 tox: Update pylint to 1.5.3.
* Handle the import fallback idiom with regard to wrong-import-order.

* Decouple the displaying of reports from the displaying of messages

  Some reporters are aggregating the messages instead of displaying
  them when they are available. The actual displaying was conflatted
  in the generate_reports. Unfortunately this behaviour was flaky
  and in the case of the JSON reporter, the messages weren't shown
  at all if a file had syntax errors or if it was missing.
  In order to fix this, the aggregated messages can now be
  displayed with Reporter.display_message, while the reports are
  displayed with display_reports.

* Ignore function calls with variadic arguments without a context.

  Inferring variadic positional arguments and keyword arguments
  will result into empty Tuples and Dicts, which can lead in
  some cases to false positives with regard to no-value-for-parameter.
  In order to avoid this, until we'll have support for call context
  propagation, we're ignoring such cases if detected.

* Treat AsyncFunctionDef just like FunctionDef nodes,
  by implementing visit_asyncfunctiondef in terms of
  visit_functiondef.

* Take in account kwonlyargs when verifying that arguments
  are defined with the check_docs extension.

* Suppress reporting 'unneeded-not' inside `__ne__` methods
2016-01-12 08:05:27 +01:00
Florian Bruhin
01ffd9f46f tox: Update hypothesis to 2.0.0.
2.0.0 - 2016-01-10
------------------

Codename: A new beginning

This release cleans up all of the legacy that accrued in the course of
Hypothesis 1.0. These are mostly things that were emitting deprecation warnings
in 1.19.0, but there were a few additional changes.

In particular:

- non-strategy values will no longer be converted to strategies when used in
  given or find.
- FailedHealthCheck is now an error and not a warning.
- Handling of non-ascii reprs in user types have been simplified by using raw
  strings in more places in Python 2.
- given no longer allows mixing positional and keyword arguments.
- given no longer works with functions with defaults.
- given no longer turns provided arguments into defaults - they will not appear
  in the argspec at all.
- the basic() strategy no longer exists.
- the n_ary_tree strategy no longer exists.
- the average_list_length setting no longer exists. Note: If you're using using
  recursive() this will cause you a significant slow down. You should pass
  explicit average_size parameters to collections in recursive calls.
- @rule can no longer be applied to the same method twice.
- Python 2.6 and 3.3 are no longer officially supported, although in practice
  they still work fine.

This also includes two non-deprecation changes:

- given's keyword arguments no longer have to be the rightmost arguments and
  can appear anywhere in the method signature.
- The max_shrinks setting would sometimes not have been respected.

1.19.0 - 2016-01-09
-------------------

Codename: IT COMES

This release heralds the beginning of a new and terrible age of Hypothesis 2.0.

It's primary purpose is some final deprecations prior to said release. The goal
is that if your code emits no warnings under this release then it will probably
run unchanged under Hypothesis 2.0 (there are some caveats to this: 2.0 will
drop support for some Python versions, and if you're using internal APIs then
as usual that may break without warning).

It does have two new features:

- New @seed() decorator which allows you to manually seed a test. This may be
  harmlessly combined with and overrides the derandomize setting.
- settings objects may now be used as a decorator to fix those settings to a
  particular @given test.

API changes (old usage still works but is deprecated):

- Settings has been renamed to settings (lower casing) in order to make the
  decorator usage more natural.
- Functions for the storage directory that were in hypothesis.settings are now
  in a new hypothesis.configuration module.

Additional deprecations:

- the average_list_length setting has been deprecated in favour of being
  explicit.
- the basic() strategy has been deprecated as it is impossible to support it
  under a Conjecture based model, which will hopefully be implemented at some
  point in the 2.x series.
- the n_ary_tree strategy (which was never actually part of the public API) has
  been deprecated.
- Passing settings or random as keyword arguments to given is deprecated (use
  the new functionality instead)

Bug fixes:

- No longer emit PendingDeprecationWarning for __iter__ and StopIteration in
  streaming() values.
- When running in health check mode with non strict, don't print quite so many
  errors for an exception in reify.
- When an assumption made in a test or a filter is flaky, tests will now raise
  Flaky instead of UnsatisfiedAssumption.
2016-01-10 21:42:57 +01:00
Florian Bruhin
60b04422a3 Replace pytest-sugar by pytest-instafail.
While pytest-sugar was nice to look at, it produced a lot of issues:

- Unusable on CI
- Unusable on OS X and Windows
- Garbage when terminal was resized during tests
- Missing space after test name since some while

This replaces it by pytest-instafail, which replaces the most important feature
of sugar, and on top of that, also works on CI.
2016-01-08 10:29:01 +01:00
Florian Bruhin
879725100f tox: Get rid of pytest-cache. 2016-01-08 10:29:01 +01:00
Florian Bruhin
a0a6b488e6 tox: Update pytest-qt to 1.11.0.
- New qt_wait_signal_raising ini option can be used to override the default
  value of the raising parameter of the qtbot.waitSignal and qtbot.waitSignals
  functions when omitted:

  Calls which explicitly pass the raising parameter are not affected.

- qtbot now has a new assertNotEmitted context manager which can be used to
  ensure the given signal is not emitted.
2016-01-08 09:38:29 +01:00
Florian Bruhin
7ed3edd00f tox: Add pytest-repeat.
Useful to track down flaky tests.
2016-01-07 21:03:48 +01:00
Florian Bruhin
b1b767ed96 tests: Don't start Xvfb for unittests-nodisp. 2016-01-06 08:36:40 +01:00
Florian Bruhin
4bae668294 tox: Update xvfbwrapper to 0.2.7.
Do not pass open file descriptors to Xvfb
2015-12-29 14:50:42 +01:00
Florian Bruhin
5f248abd7d tox: Update requests to 2.9.1.
Bugfixes

- Resolve regression introduced in 2.9.0 that made it impossible to send binary
  strings as bodies in Python 3.
- Fixed errors when calculating cookie expiration dates in certain locales.

Miscellaneous

- Updated bundled urllib3 to 1.13.1.
2015-12-29 14:47:42 +01:00
Florian Bruhin
2f51dae2b3 tox: Update hypothesis to 1.18.1.
- Hypothesis will no longer write generated code to the file system. This will
  improve performance on some systems (e.g. if you're using PythonAnywhere
  which is running your code from NFS) and prevent some annoying interactions
  with auto-restarting systems.

- Hypothesis will cache the creation of some strategies. This can significantly
  improve performance for code that uses flatmap or composite and thus has to
  instantiate strategies a lot.
2015-12-29 14:45:49 +01:00
Florian Bruhin
b7998838d3 tox: Update astroid to 1.4.3.
* pkg_resources brain tips are a bit more specific, by specifiying proper
  returns.
* Standard library modules are properly detected by is_standard_module.
2015-12-29 14:44:00 +01:00
Florian Bruhin
e9bf5fc219 tox: Update hypothesis to 1.18.0.
Features:

- Tests and find are now explicitly seeded off the global random module. This
  means that if you nest one inside the other you will now get a health check
  error. It also means that you can control global randomization by seeding
  random.
- There is a new random_module() strategy which seeds the global random module
  for you and handles things so that you don't get a health check warning if
  you use it inside your tests.
- floats() now accepts two new arguments: allow_nan and allow_infinity. These
  default to the old behaviour, but when set to False will do what the names
  suggest.

Bug fixes:

- Fix a bug where tests that used text() on Python 3.4+ would not actually be
  deterministic even when explicitly seeded or using the derandomize mode,
  because generation depended on dictionary iteration order which was affected
  by hash randomization.
- Fix a bug where with complicated strategies the timing of the initial health
  check could affect the seeding of the subsequent test, which would also
  render supposedly deterministic tests non-deterministic in some scenarios.
- In some circumstances flatmap() could get confused by two structurally
  similar things it could generate and would produce a flaky test where the
  first time it produced an error but the second time it produced the other
  value, which was not an error. The same bug was presumably also possible in
  composite().
- flatmap() and composite() initial generation should now be moderately faster.
  This will be particularly noticeable when you have many values drawn from the
  same strategy in a single run, e.g. constructs like lists(s.flatmap(f)).
  Shrinking performance may have suffered, but this didn't actually produce an
  interestingly worse result in any of the standard scenarios tested.
2015-12-21 11:19:01 +01:00
Florian Bruhin
12f44d0a5e tox: Update astroid to 1.4.2 and pylint to 1.5.2. 2015-12-21 09:17:26 +01:00
Florian Bruhin
2b1622b34d Update to pytest-bdd 2.16.0.
This avoids deprecation warnings emitted by python 3.5 and pytest 2.8.
2015-12-20 20:11:49 +01:00
Florian Bruhin
84ed602b8d tox: Update Werkzeug to 0.11.3.
- Fixed an issue with copy operations not working against
  proxies.
- Changed the logging operations of the development server to
  correctly log where the server is running in all situations
  again.
- Fixed another regression with SSL wrapping similar to the
  fix in 0.11.2 but for a different code path.
2015-12-20 17:26:19 +01:00
Florian Bruhin
3687011e09 tox: Update CherryPy to 5.0.0.
-----
5.0.0
-----

* Removed deprecated support for ``ssl_certificate`` and
  ``ssl_private_key`` attributes and implicit construction
  of SSL adapter on Python 2 WSGI servers.
* Default SSL Adapter on Python 2 is the builtin SSL adapter,
  matching Python 3 behavior.

-----
4.0.0
-----

* Drop support for Python 2.5 and earlier.
* No longer build Windows installers by default.
2015-12-20 17:25:08 +01:00
Florian Bruhin
eed4a992ab tox: Update cherrypy to 3.8.2.
* Correct InternalServerError when null bytes in static file path. Now responds
  with 404 instead.
2015-12-18 05:19:33 +01:00
Florian Bruhin
f19de5b908 tox: Update hypothesis to 1.17.1.
A small bug fix release, which fixes the fact that the 'note' function could
not be used on tests which used the @example decorator to provide explicit
examples.
2015-12-17 08:01:47 +01:00
Florian Bruhin
e9a0dffe3b tox: Update pytest-qt to 1.10.0.
- SignalBlocker now has a args attribute with the arguments of the signal that
  triggered it, or None on a time out.
- MultiSignalBlocker is now properly disconnects from signals upon exit.
2015-12-17 06:59:13 +01:00
Florian Bruhin
a1f4914271 tox: Update pytest-faulthandler to 1.3.0.
Now stops timeout when handling exceptions interactively.
2015-12-16 23:09:02 +01:00
Florian Bruhin
a387e9669c tox: Update requests to 2.9.0.
Minor Improvements (Backwards compatible)

- The verify keyword argument now supports being passed a path to a directory
  of CA certificates, not just a single-file bundle.
- Warnings are now emitted when sending files opened in text mode.
- Added the 511 Network Authentication Required status code to the status code
  registry.

Bugfixes

- For file-like objects that are not seeked to the very beginning, we now send
  the content length for the number of bytes we will actually read, rather than
  the total size of the file, allowing partial file uploads.
- When uploading file-like objects, if they are empty or have no obvious
  content length we set Transfer-Encoding: chunked rather than
  Content-Length: 0.
- We correctly receive the response in buffered mode when uploading chunked
  bodies.
- We now handle being passed a query string as a bytestring on Python 3, by
  decoding it as UTF-8.
- Sessions are now closed in all cases (exceptional and not) when using the
  functional API rather than leaking and waiting for the garbage collector to
  clean them up.
- Correctly handle digest auth headers with a malformed qop directive that
  contains no token, by treating it the same as if no qop directive was
  provided at all.
- Minor performance improvements when removing specific cookies by name.
2015-12-15 17:58:51 +01:00
Florian Bruhin
90c782a891 Revert "Avoid setenv substitution in tox.ini."
This reverts commit 7245e300e6.
This was fixed in tox 2.3.1.
2015-12-15 11:49:06 +01:00
Florian Bruhin
a2423b0b6c tox: Update hypothesis to 1.17.0.
This is actually the same release as 1.16.1, but 1.16.1 has been pulled because
it contains the following additional change that was not intended to be in a
patch release (it's perfectly stable, but is a larger change that should have
required a minor version bump):

Hypothesis will now perform a series of "health checks" as part of running your
tests. These detect and warn about some common error conditions that people
often run into which wouldn't necessarily have caued the test to fail but would
cause e.g. degraded performance or confusing results.
2015-12-15 11:48:07 +01:00
Florian Bruhin
c74bcf95aa tox: Update hypothesis to 1.16.1.
A small bugfix release that allows bdists for Hypothesis to be built under 2.7
- the compat3.py file which had Python 3 syntax wasn't intended to be loaded
under Python 2, but when building a bdist it was. In particular this would
break running setup.py test.
2015-12-15 06:59:06 +01:00
Florian Bruhin
879f99bddf tox: Update pytest to 2.8.5.
- fixed issue where class attributes injected during collection could break pytest.
- precompute junitxml chunks instead of storing the whole tree in objects
- fix ``pytest.deprecated_call()`` receiving multiple arguments
  (Regression introduced in 2.8.4).
2015-12-13 13:17:53 +01:00
Florian Bruhin
7245e300e6 Avoid setenv substitution in tox.ini.
This works around a bug with tox 2.3.0:
https://bitbucket.org/hpk42/tox/issues/294/
2015-12-11 21:39:41 +01:00
Florian Bruhin
b3b2fb51fc tox: Update pytest-faulthandler to 1.2.0.
Now traceback dumping due to a timeout is cancelled when entering pdb.
2015-12-11 06:42:24 +01:00
Florian Bruhin
9b88167ae1 tox: Update decorator to 4.0.6.
Removed a file x.py accidentally entered in the tarball
2015-12-11 06:41:42 +01:00
Florian Bruhin
bed37defde tox: Update check-manifest to 0.30.
- Support git submodules
- Revert the zc.buildout support hack from 0.26 because it causes breakage
- Improve non-ASCII filename handling with Bazaar on Windows.
2015-12-11 06:40:49 +01:00
Florian Bruhin
dc4600008b tox: Update xvfbwrapper to 0.2.6.
Drops Python 2.6 support, no other notable changes it seems.
2015-12-10 06:10:51 +01:00