Commit Graph

463 Commits

Author SHA1 Message Date
Florian Bruhin
0c4a961505 tox: Upgrade hypothesis to 3.0.2.
(3.0.2: performance fix)

------------------
3.0.1 - 2016-02-18
------------------

* Fix a case where it was possible to trigger an "Unreachable" assertion when
  running certain flaky stateful tests.
* Improve shrinking of large stateful tests by eliminating a case where it was
  hard to delete early steps.
* Improve efficiency of drawing binary(min_size=n, max_size=n) significantly by
  provide a custom implementation for fixed size blocks that can bypass a lot
  of machinery.
* Set default home directory based on the current working directory at the
  point Hypothesis is imported, not whenever the function first happens to be
  called.

------------------
3.0.0 - 2016-02-17
------------------

Codename: This really should have been 2.1.

Externally this looks like a very small release. It has one small breaking change
that probably doesn't affect anyone at all (some behaviour that never really worked
correctly is now outright forbidden) but necessitated a major version bump and one
visible new feature.

Internally this is a complete rewrite. Almost nothing other than the public API is
the same.

New features:

* Addition of data() strategy which allows you to draw arbitrary data interactively
  within the test.
* New "exploded" database format which allows you to more easily check the example
  database into a source repository while supporting merging.
* Better management of how examples are saved in the database.
* Health checks will now raise as errors when they fail. It was too easy to have
  the warnings be swallowed entirely.

New limitations:

* choices and streaming strategies may no longer be used with find(). Neither may
  data() (this is the change that necessitated a major version bump).

Feature removal:

* The ForkingTestCase executor has gone away. It may return in some more working
  form at a later date.

Performance improvements:

* A new model which allows flatmap, composite strategies and stateful testing to
  perform *much* better. They should also be more reliable.
* Filtering may in some circumstances have improved significantly. This will
  help especially in cases where you have lots of values with individual filters
  on them, such as lists(x.filter(...)).
* Modest performance improvements to the general test runner by avoiding expensive
  operations

In general your tests should have got faster. If they've instead got significantly
slower, I'm interested in hearing about it.

Data distribution:

The data distribution should have changed significantly. This may uncover bugs the
previous version missed. It may also miss bugs the previous version could have
uncovered. Hypothesis is now producing less strongly correlated data than it used
to, but the correlations are extended over more of the structure.

Shrinking:

Shrinking quality should have improved. In particular Hypothesis can now perform
simultaneous shrinking of separate examples within a single test (previously it
was only able to do this for elements of a single collection). In some cases
performance will have improved, in some cases it will have got worse but generally
shouldn't have by much.
2016-02-18 20:46:15 +01:00
Florian Bruhin
5c617b861c Switch to pytest-xvfb. Fixes #1309. 2016-02-16 20:36:23 +01:00
Florian Bruhin
3aaa4395b8 tox: Update Werkzeug to 0.11.4.
- Fixed werkzeug.serving not working from -m flag.
- Fixed incorrect weak etag handling.
2016-02-15 07:08:31 +01:00
Florian Bruhin
8534010f02 tox: Update flake8 to 2.5.4.
Actually parse output_file and enable_extensions from config files.
2016-02-11 19:29:05 +01:00
Florian Bruhin
5311576c34 Check pep257 via flake8.
We'll still keep the pydocstyle environment though until flake8-pep257 adds
support for that:

https://github.com/Robpol86/flake8-pep257/issues/6
2016-02-10 19:18:47 +01:00
Florian Bruhin
d6267c30f6 tox: Update decorator to 4.0.9.
No changes.
2016-02-08 23:46:41 +01:00
Florian Bruhin
5ae677376b Rerun TestPyQIODevice.test_qprocess if needed.
This adds a new pytest-rerunfailures dependency. For some reason, that test
sometimes fails with an empty string read, and I can't tell why.
2016-02-08 06:54:47 +01:00
Florian Bruhin
c332db4703 tox: Update decorator to 4.0.8.
Switched to a new changelog format (the one in http://keepachangelog.com/)
since it was contributed by Alexander Artemenko. Re-added a newline to support
old version of Python, as requested by azjps.
2016-02-07 17:57:39 +01:00
Florian Bruhin
66f52dbd86 tox: Update wheel to 0.29.0.
- Fix compression type of files in archive
2016-02-07 12:31:08 +01:00
Florian Bruhin
e3508cc37c tox: Filter decorator==4.0.7 for requirements.io.
See https://github.com/micheles/decorator/issues/25
2016-02-07 12:13:51 +01:00
Florian Bruhin
8f74734718 tox: Update cherrypy to 5.0.1.
* 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.
* In proxy tool, defer to Host header for resolving the base if no base is
  supplied.
2016-02-06 16:35:29 +01:00
Florian Bruhin
7ef368fc13 tox: Update wheel to 0.28.0.
- Fix file modes in archive
- Support forcing a platform tag using –plat-name on pure-Python wheels, as
  well as nonstandard platform tags on non-pure wheels
- Add SOABI tags to platform-specific wheels built for Python 2.X
- Support reproducible wheel files, wheels that can be rebuilt and will hash to
  the same values as previous builds
- Support for changes in keyring >= 8.0
- Use the file context manager when checking if dependency_links.txt is empty,
  fixes problems building wheels under PyPy on Windows
- Don’t attempt to (recursively) create a build directory ending with ..
  (invalid on all platforms, but code was only executed on Windows)
- Added the PyPA Code of Conduct
2016-02-06 16:33:37 +01:00
Florian Bruhin
30f68e55d6 tox: Update xvfbwrapper to 0.2.8.
- better error handling when xvfb is not installed
- don't hardcode tmp dir location
- use terminate instead of kill so Xvfb can clean up lock files
2016-01-31 13:06:28 +01:00
Florian Bruhin
bf2adf19b2 tox: Update pytest-cov to 2.2.1.
- Fixed incorrect merging of coverage data when xdist was used and coverage was
  >= 4.0.
2016-01-30 23:39:55 +01:00
Florian Bruhin
c9deee0835 tox: Update flake8 to 2.5.2.
- Parse output_file and enable_extensions from config files
- Raise upper bound on mccabe plugin to allow for version 0.4.0
2016-01-30 23:39:55 +01:00
Florian Bruhin
67fd94b189 tox: Update check-manifest to 0.31.
- Drop Python 3.2 support.
- Ignore commented-out lines in MANIFEST.in.
2016-01-30 23:39:55 +01:00
Florian Bruhin
dc07f7ca9b Add a .pydocstylerc. 2016-01-30 23:39:55 +01:00
Florian Bruhin
39ca471685 tox: Switch from pep257 to pydocstyle.
Major Updates
-------------

The project was renamed to pydocstyle and the new release will be 1.0.0!

New Features
------------

- Added support for Python 3.5.
- Classes nested inside classes are no longer considered private. Nested
  classes are considered public if their names are not prepended with an
  underscore and if their parent class is public, recursively.
- Added the D403 error code - "First word of the first line should be properly
  capitalized". This new error is turned on by default.
- Added support for .pydocstylerc and as configuration file name.

Bug Fixes
---------

- Fixed an issue where a NameError was raised when parsing complex definitions
  of __all__.
- Fixed a bug where D202 was falsely reported when a function with just a
  docstring and no content was followed by a comment.
- Fixed wrong __all__ definition in main module.
- Fixed a bug where an AssertionError could occur when parsing __future__
  imports.
2016-01-30 23:23:21 +01:00
Florian Bruhin
6af1cce45f tox: Update pytest-mock to 0.10.1.
- Fix regression in frozen tests due to distutils import dependency.
- Fix regression when using pytest-mock with pytest-2.7.X.
2016-01-28 06:22:00 +01:00
Florian Bruhin
b4972b3c08 tox: Update pytest-mock to 0.10.0.
pytest-mock now monkeypatches the mock library to improve pytest output
for failures of mock call assertions like Mock.assert_called_with().
2016-01-27 22:32:21 +01:00
Florian Bruhin
2b6d35b987 tox: Update mccabe to 0.4.0.
- Stop testing on Python 3.2
- Add support for async/await keywords on Python 3.5 from PEP 0492
2016-01-27 22:30:58 +01:00
Florian Bruhin
dcd62abe2b tox: Update httpbin to 0.4.1.
Added floating-point support for /delay endpoint
2016-01-27 22:20:07 +01:00
Florian Bruhin
959e96f05a tox: Update ebb-lint to 0.4.4
- Read from stdin
- Strip trailing whitespace and \ before tokenizing.
- EOF bug?
2016-01-27 06:41:00 +01:00
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
Florian Bruhin
fd63b21261 tox: Update pytest-catchlog to 1.2.1.
- Allow caplog.records() to be modified.
- Restore Python 2.6 compatibility.
2015-12-09 17:34:29 +01:00
Florian Bruhin
8d7e43e4c4 tox: Update hypothesis to 1.16.0.
There are no public API changes in this release but it includes a behaviour
change that I wasn't comfortable putting in a patch release.

- Functions from hypothesis.strategies will no longer raise InvalidArgument on
  bad arguments. Instead the same errors will be raised when a test using such
  a strategy is run. This may improve startup time in some cases, but the main
  reason for it is so that errors in strategies won't cause errors in loading,
  and it can interact correctly with things like pytest.mark.skipif.
- Errors caused by accidentally invoking the legacy API are now much less
  confusing, although still throw NotImplementedError.
- hypothesis.extra.django is 1.9 compatible.
- When tests are run with max_shrinks=0 this will now still rerun the test on
  failure and will no longer print "Trying example:" before each run.
  Additionally note() will now work correctly when used with max_shrinks=0.
2015-12-09 17:32:45 +01:00
Florian Bruhin
73b4704d6c tox: Update decorator to 4.0.5.
Documented a quirk signaled by David Goldstein when writing decorators for
functions with keyword arguments. Avoided copying the globals, as signaled by
Benjamin Peterson (2015/12/09)
2015-12-09 17:30:42 +01:00
Florian Bruhin
dddd1e87a5 tox: Update pytest to 2.8.4.
- ``deprecated_call()`` now works when the deprecated function has been already
  called by another test in the same module.
- ``--pastebin`` option now works on Python 3.
- ``--pastebin`` now works correctly when captured output contains non-ascii
  characters.
- Fix another error when collecting with a nasty __getattr__().
- fix the summary printed when no tests did run.
- a number of documentation modernizations wrt good practices.
2015-12-06 22:22:33 +01:00
Florian Bruhin
2a030107b9 tox: Upgrade CherryPy to 3.8.0.
Pass ``exc_info`` to logger as keyword rather than formatting the error and
injecting into the message.
2015-12-04 07:16:34 +01:00
Florian Bruhin
cab6bf87b4 tox: Update to pylint 1.5.1.
* Don't emit unsubscriptable-object if the node is found
  inside an abstract class.

* Add wrong-import-position to check_messages's decorator arguments
  for ImportChecker.leave_module

  This fixes an esoteric bug which occurs when ungrouped-imports and
  wrong-import-order are disabled and pylint is executed on multiple files.
  What happens is that without wrong-import-position in check_messages,
  leave_module will never be called, which means that the first non-import node
  from other files might leak into the current file,
  leading to wrong-import-position being emitted by pylint.

* Fix a crash which occurred when old visit methods are encountered
  in plugin modules.

* Don't emit import-self and cyclic-import for relative imports
  of modules with the same name as the package itself.
2015-12-02 17:53:59 +01:00
Florian Bruhin
e1f53302be Revert "tox: Add {posargs} for pylint."
This breaks on Travis/AppVeyor were different environments all get the same
args.
This reverts commit b59951cc98.
2015-12-01 22:51:03 +01:00
Florian Bruhin
b59951cc98 tox: Add {posargs} for pylint. 2015-12-01 20:05:19 +01:00
Florian Bruhin
81f522336f Do PYTHONPATH shenanigans in run_pylint_on_tests.
If we do it in tox.ini, there are two drawbacks:

- We have more stuff in PYTHONPATH even if we don't when actually using
  qutebrowser.
- The separator is platform specific, so we can't easily do this in a portable
  way in tox.ini.
2015-12-01 08:07:42 +01:00
Florian Bruhin
009e29789a tox: Add {toxinidir} to PYTHONPATH for pylint.
Seems like it doesn't like to import qutebrowser from the tests anymore
otherwise...
2015-12-01 07:10:39 +01:00
Florian Bruhin
5dc891f207 pylint: Move expected-line-ending-format to config. 2015-11-30 21:08:17 +01:00
Florian Bruhin
41b9fd7853 tox: Remove --rcfile for pylint.
We don't need this anymore as pylint now reads .pylintrc automatically.
2015-11-30 21:08:17 +01:00
Florian Bruhin
a987c08b69 tox: Set basepython = python3 for pylint. 2015-11-30 07:38:49 +01:00
Florian Bruhin
0004bebc09 tox: Update astroid/pylint to 1.4.1/1.5.0.
This means logilab-common isn't needed anymore and it runs with python 3.5 now.
2015-11-30 07:15:40 +01:00
Florian Bruhin
a008b488b1 tox: Set ignore_errors for some environments.
We want to run pylint on tests as well if the first pylint invocation failed.
2015-11-30 07:00:20 +01:00
Florian Bruhin
03b6459d2f tox: Update py to 1.4.31. 2015-11-28 20:38:20 +01:00
Florian Bruhin
eaec930605 tox: Update coverage to 4.0.3.
- Fixed a mysterious problem that manifested in different ways: sometimes
  hanging the process, sometimes making database connections fail.
- The XML report now has correct <source> elements when using a --source=
  option somewhere besides the current directory.
- Fixed an unusual edge case of detecting source encodings
- Help messages that mention the command to use now properly use the actual
  command name, which might be different than “coverage”.
2015-11-24 21:35:29 +01:00
Florian Bruhin
f48bebb7ff tox: Update hypothesis to 1.15.0.
A release with two new features.

- A 'characters' strategy for more flexible generation of text with particular
  character ranges and types.
- Add support for preconditions to the rule based stateful testing.
2015-11-24 21:34:43 +01:00
Florian Bruhin
16e1a65448 Merge branch 'download-page' of https://github.com/Kingdread/qutebrowser into Kingdread-download-page 2015-11-23 13:16:16 +01:00
Florian Bruhin
8607d527bf tox: Update check-manifest to 0.29.
Fix --python with just a command name, to be found in path.
2015-11-21 10:44:58 +01:00
Daniel Schadt
3466ee03f6 Change development server to cherrypy.wsgiserver
The Flask/Werkzeug development servers had some issues which lead to
failing tests (together with some Qt bugs).
2015-11-20 13:35:24 +01:00
Florian Bruhin
22a8f8def6 tox: Update pytest to 2.8.3.
- add __name__ attribute to testcases in TestCaseFunction to support the
  @unittest.skip decorator on functions and methods.
- collecting tests if test module level obj has __getattr__().
- don't collect tests if their failure cannot be reported correctly e.g. they
  are a callable instance of a class.
- fixed internal error when filtering tracebacks where one entry belongs to a
  file which is no longer available.
- enhancement made to highlight in red the name of the failing tests so
  they stand out in the output.
- minor fixes for interaction with OS X El Capitan system integrity
  protection
2015-11-19 23:00:04 +01:00
Florian Bruhin
bb807cfa07 tox: Update pytest-mock to 0.9.0.
New mocker.resetall function, which calls reset_mock() in all mocked objects up
to that point.
2015-11-18 21:15:36 +01:00
Florian Bruhin
ea5484c3a2 Fix nitpicks. 2015-11-17 19:46:24 +01:00
Florian Bruhin
f20ffca540 Merge branch 'issue923' of https://github.com/lamarpavel/qutebrowser into lamarpavel-issue923 2015-11-17 19:43:35 +01:00
Florian Bruhin
3695e05691 Use pytest-faulthandler on all platforms. 2015-11-13 06:23:31 +01:00
Florian Bruhin
55b83409d9 tox: Update pytest-faulthandler to 1.1.0.
--faulthandler-timeout option is now properly supported in Python 3+; also a
warning is issued instead of an error on platforms without a
faulthandler.dump_traceback_later function.
2015-11-13 06:22:29 +01:00
Florian Bruhin
ef79b87597 tox: Update Werkzeug to 0.11.2.
- Fix inheritable sockets on Windows on Python 3.
- Fixed an issue with the forking server not starting any longer.
- Fixed SSL wrapping on platforms that supported opening sockets
  by file descriptor.
- No longer log from the watchdog reloader.
- Unicode errors in hosts are now better catched or converted into
  bad request errors.
2015-11-12 20:30:26 +01:00
Florian Bruhin
3680f01576 Switch to pytest 2.8.
Closes #1077.

There were two issues:

- Paths for coverage.py suddenly were absolute instead of relative, so we strip
  the common base part if that happens.

  /home/florian/proj/qutebrowser/git/qutebrowser/browser/cookies.py has 100%
  coverage but is not in perfect_files!
  /home/florian/proj/qutebrowser/git/qutebrowser/browser/http.py has 100%
  coverage but is not in perfect_files!
  [...]

- There was an io.UnsupportedOperationError in test_check_coverage.py because
  of pytest-faulthandler, so we just don't load that in the subprocess.
2015-11-11 20:57:47 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
a5efbe7412 tox: Update check-manifest to 0.28.
- Fix detection of git submodules.
- Apply ignore patterns in subdirectories too.
2015-11-11 14:57:45 +01:00
Florian Bruhin
cd25a25c96 tox: Update werkzeug to 0.11.1
- Fixed a regression on Python 3 in the debugger.
2015-11-10 19:14:55 +01:00
Florian Bruhin
99e090db78 tox: Update werkzeug to 0.11.
Version 0.11
------------

Released on November 8th 2015, codename Gleisbaumaschine.

- Added ``reloader_paths`` option to ``run_simple`` and other functions in
  ``werkzeug.serving``. This allows the user to completely override the Python
  module watching of Werkzeug with custom paths.
- Many custom cached properties of Werkzeug's classes are now subclasses of
  Python's ``property`` type.
- ``bind_to_environ`` now doesn't differentiate between implicit and explicit
  default port numbers in ``HTTP_HOST``.
- ``BuildErrors`` are now more informative. They come with a complete sentence
  as error message, and also provide suggestions.
- Fix a bug in the user agent parser where Safari's build number instead of
  version would be extracted.
- Fixed issue where RedisCache set_many was broken for twemproxy, which doesn't
  support the default MULTI command.
- ``mimetype`` parameters on request and response classes are now always
  converted to lowercase.
- Changed cache so that cache never expires if timeout is 0. This also fixes
  an issue with redis setex
- Werkzeug now assumes ``UTF-8`` as filesystem encoding on Unix if Python
  detected it as ASCII.
- New optional `has` method on caches.
- Fixed various bugs in `parse_options_header`.
- If the reloader is enabled the server will now open the socket in the parent
  process if this is possible.  This means that when the reloader kicks in
  the connection from client will wait instead of tearing down.  This does
  not work on all Python versions.
- Implemented PIN based authentication for the debugger.  This can optionally
  be disabled but is discouraged.  This change was necessary as it has been
  discovered that too many people run the debugger in production.
- Devserver no longer requires SSL module to be installed.

Version 0.10.5
--------------

(bugfix release, release date yet to be decided)

- Reloader: Correctly detect file changes made by moving temporary files over
  the original, which is e.g. the case with PyCharm.
- Fix bool behavior of ``werkzeug.datastructures.ETags`` under Python 3
2015-11-09 09:46:36 +01:00
Florian Bruhin
30db09bbda tox: Update pyroma to 1.8.3.
- Checking a PyPI package could fail under Python 3.
2015-11-09 09:46:02 +01:00
Florian Bruhin
8ccadda0e9 tox: Update pytest-travis-fold to 1.2.0.
- Recognize 'pytest-cov' and fold coverage report
2015-11-04 23:15:51 +01:00
Florian Bruhin
5fc26bc477 tox: Update coverage to 4.0.2.
- More work on supporting unusually encoded source.
- Files or directories with non-ASCII characters are now handled properly.
- Setting a trace function with sys.settrace was broken by a change in 4.0.1.
- Officially support PyPy 4.0, which required no changes, just updates to the
  docs.
2015-11-04 17:59:46 +01:00
Florian Bruhin
16ba597173 tox: Update check-manifest to 0.27.
Fix utter breakage on Windows, introduced in 0.26. (The bug -- clearing the
environment unnecessarily -- could probably also cause locale-related problems
on other OSes.)
2015-11-02 17:53:20 +01:00
Florian Bruhin
362ef3f74e tox: Fix pylint deps. 2015-11-02 08:01:54 +01:00
Florian Bruhin
611cf7eba7 tox: Re-freeze test dependencies. 2015-11-02 07:47:48 +01:00
Florian Bruhin
0d67cff5cb Merge branch 'bdd'
Conflicts:
      tests/test_conftest.py
      tox.ini
2015-11-02 06:36:30 +01:00
Florian Bruhin
86d32f6e19 Set basepython = python3.4 for unittests-frozen. 2015-11-01 22:47:58 +01:00
Florian Bruhin
670a4d274b Add pytest-bdd to tox.ini. 2015-11-01 22:40:11 +01:00
Florian Bruhin
76fcec4e4c tests: First steps towards end-to-end tests. 2015-11-01 22:40:11 +01:00
Florian Bruhin
79e80afac8 tox: Update pytest-qt to 1.9.0.
- Exception capturing now happens as early/late as possible in order to catch
  all possible exceptions (including fixtures).
- Widgets registered by qtbot.addWidget are now closed before all other
  fixtures are tear down.
- qtbot now has a new wait method which does a blocking wait while the event
  loop continues to run, similar to QTest::qWait.
- raise RuntimeError instead of ImportError when failing to import any Qt
  binding: raising the latter causes pluggy in pytest-2.8 to generate a subtle
  warning instead of a full blown error.
2015-11-01 17:39:42 +01:00
Florian Bruhin
998d78c5b9 tox: Update hypothesis to 1.14.0.
New features:

* Add 'note' function which lets you include additional information in the
  final test run's output.
* Add 'choices' strategy which gives you a choice function that emulates
  random.choice.
* Add 'uuid' strategy that generates UUIDs'
* Add 'shared' strategy that lets you create a strategy that just generates a
  single shared value for each test run

Bugs:

* Using strategies of the form streaming(x.flatmap(f)) with find or in stateful
  testing would have caused InvalidArgument errors when the resulting values
  were used (because code that expected to only be called within a test context
  would be invoked).
2015-11-01 17:38:05 +01:00
Florian Bruhin
e5b98a9762 tox: Update check-manifest to 0.26.
* Do not complain about missing .gitattributes file.
* Normalize unicode representation and case of filenames.
* Drop Python 2.6 support.
* Support installation via zc.buildout better.
2015-10-30 18:46:50 +01:00
Florian Bruhin
d2672bce86 tox: Update hypothesis to 1.13.0
This is quite a small release, but deprecates some public API functions and
removes some internal API functionality so gets a minor version bump.

- All calls to the 'strategy' function are now deprecated, even ones which pass
  just a SearchStrategy instance (which is still a no-op).
- Never documented hypothesis.extra entry_points mechanism has now been removed
  (it was previously how hypothesis.extra packages were loaded and has been
  deprecated and unused for some time)
- Some corner cases that could previously have produced an OverflowError when
  simplifying failing cases using hypothesis.extra.datetimes (or dates or
  times) have now been fixed.
- Hypothesis load time for first import has been significantly reduced - it
  used to be around 250ms (on my SSD laptop) and now is around 100-150ms. This
  almost never matters but was slightly annoying when using it in the console.
- hypothesis.strategies.randoms was previously missing from __all__.
2015-10-30 07:42:09 +01:00
Florian Bruhin
7656d1320a tox: Update pytest-travis-fold to 1.1.1. 2015-10-26 18:55:44 +01:00
Florian Bruhin
4fcb2feced tox: Add a pylint-tip testenv. 2015-10-26 18:51:41 +01:00
Florian Bruhin
c335aff900 Revert "Add pytest-timeout."
This reverts commit 8919a152fe.

Seems to cause more trouble than it's worth... bogus timeouts on OS X and
Windows, with Windows then hanging...
2015-10-26 08:53:55 +01:00
Florian Bruhin
8919a152fe Add pytest-timeout. 2015-10-26 07:33:32 +01:00
Florian Bruhin
8dc5c95cef tox: Pass TRAVIS to testenvs.
This hopefully makes pytest-travis-fold work correctly.
2015-10-26 07:31:12 +01:00
Florian Bruhin
023d80fe40 Set source in .coveragerc.
This should make codecov.io pick the right source files up too.
2015-10-23 19:14:46 +02:00
Florian Bruhin
de0542929a tox: Update httpbin to 0.4.0.
- New /image/svg endpoint
- add deploy to heroku button
- add 406 response to /image
- don't always emit the transfer-encoding header for stream endpoint.
2015-10-22 22:24:40 +02:00
Florian Bruhin
aba31babca Add some tests for run_vulture.py. 2015-10-20 23:42:01 +02:00
Lamar Pavel
08bbb6b7c7 Consider new UA script in tox tests
To avoid failing tests tox now includes one of the modules required by
the script and the latter informs pylint to ignore one of the imports.
2015-10-20 17:30:39 +02:00
Florian Bruhin
0a40dfced6 tox: Update to pytest-travis-fold to 1.1.0.
- Move auxiliary logic from TravisContext into module-level functions
- Add 'travis' fixture and functions for folding given string/lines
2015-10-19 22:06:50 +02:00
Florian Bruhin
8e0389fd37 tox: Update pytest-html to 1.7.
- Add report sections including stdout and stderr to log.
- Fix INTERNALERROR when an xdist slave crashes.
2015-10-19 19:41:35 +02:00
Florian Bruhin
7519694e22 tox: Update hypothesis to 1.12.0.
- Significantly improved performance of creating strategies using the functions
  from the hypothesis.strategies module by deferring the calculation of their
  repr until it was needed. This is unlikely to have been an performance issue
  for you unless you were using flatmap, composite or stateful testing, but for
  some cases it could be quite a significant impact.
- A number of cases where the repr of strategies build from lambdas is improved
- Add dates() and times() strategies to hypothesis.extra.datetimes
- Add new 'profiles' mechanism to the settings system
- Deprecates mutability of Settings, both the Settings.default top level
  property and individual settings.
- A Settings object may now be directly initialized from a parent Settings.
- @given should now give a better error message if you attempt to use it with a
  function that uses destructuring arguments (it still won't work, but it will
  error more clearly),
- A number of spelling corrections in error messages
- py.test should no longer display the intermediate modules Hypothesis
  generates when running in verbose mode
- Hypothesis should now correctly handle printing objects with non-ascii reprs
  on python 3 when running in a locale that cannot handle ascii printing to
  stdout.
- Add a unique=True argument to lists(). This is equivalent to unique_by=lambda
  x: x, but offers a more convenient syntax.
2015-10-19 07:35:27 +02:00
Florian Bruhin
a88962fa98 tox: Update pytest-travis-fold to 1.0.1. 2015-10-18 22:26:25 +02:00
Florian Bruhin
71e6c38065 tox: Update to pytest-qt 1.8.0.
- pytest.mark.qt_log_ignore now supports an extend parameter that will extend
  the list of regexes used to ignore Qt messages (defaults to False).

- Fixed internal error when interacting with other plugins that raise an error,
  hiding the original exception.
2015-10-16 06:20:07 +02:00
Florian Bruhin
619f47ee1d tox: Add pytest-travis-fold 2015-10-15 21:40:17 +02:00
Florian Bruhin
26596316c6 Pin some more dependencies in tox.ini.
This hard-pins everything except for the main [testenv].
2015-10-14 18:28:39 +02:00
Florian Bruhin
d3925e91a3 tox: Update coverage to 4.0.1.
- When combining data files, unreadable files will now generate a warning
  instead of failing the command.  This is more in line with the older
  coverage.py v3.7.1 behavior, which silently ignored unreadable files.

- The --skip-covered option would skip reporting on 100% covered files, but
  also skipped them when calculating total coverage.  This was wrong, it should
  only remove lines from the report, not change the final answer.  This is now
  fixed.

- In 4.0, the data file recorded a summary of the system on which it was run.
  Combined data files would keep all of those summaries.  This could lead to
  enormous data files consisting of mostly repetitive useless information. That
  summary is now gone.  If you want summary information,
  get in touch, and we'll figure out a better way to do it.

- Test suites that mocked os.path.exists would experience strange failures, due
  to coverage.py using their mock inadvertently.  This is now fixed.

- Importing a ``__init__`` module explicitly would lead to an error:
  ``AttributeError: 'module' object has no attribute '__path__'``.  This is now
  fixed.

- Code that uses ``sys.settrace(sys.gettrace())`` used to incur a more than 2x
  speed penalty.  Now there's no penalty at all.

- Pyexpat C code will no longer be recorded as a source file.

- The source kit now contains all of the files needed to have a complete source
  tree.
2015-10-14 07:00:40 +02:00
Florian Bruhin
28a28763c7 tox: Update logilab-common to 1.1.0.
* configuration: have a stable order for sections
* testlib: clean out deprecated TestCase methods, move pytest specifics to pytest.py
* fix a few python3 bugs in umessage, configuration and optik_ext modules
* testlib: report failures and skips in generative tests properly
* optik_ext: return bytes as ints and not floats
2015-10-12 19:06:49 +02:00
Florian Bruhin
f8ad011a32 tox: Update pytest-sugar to 0.5.1.
- Colour progressbar correctly for low number of tests
- Fix error case when deactivating pytest-sugar using --lf together with
  --nosugar
- --nosugar deprecated, use -p no:sugar
2015-10-12 19:05:59 +02:00
Florian Bruhin
9c0ef87a62 tox: Update pep257 to 0.7.0.
Upstream changelog:

New Features

- Added the D104 error code - "Missing docstring in public package". This new
  error is turned on by default. Missing docstring in __init__.py files which
  previously resulted in D100 errors ("Missing docstring in public module")
  will now result in D104.

- Added the D105 error code - "Missing docstring in magic method'. This new
  error is turned on by default. Missing docstrings in magic method which
  previously resulted in D102 error ("Missing docstring in public method") will
  now result in D105. Note that exceptions to this rule are variadic magic
  methods - specifically __init__, __call__ and __new__, which will be
  considered non-magic and missing docstrings in them will result in D102.

- Support the option to exclude all error codes. Running pep257 with --select=
  (or select= in the configuration file) will exclude all errors which could
  then be added one by one using add-select. Useful for projects new to pep257.

- Added check D211: No blank lines allowed before class docstring. This change
  is a result of a change to the official PEP257 convention. Therefore, D211
  will now be checked by default instead of D203, which required a single blank
  line before a class docstring.

- Configuration files are now handled correctly. The closer a configuration
  file is to a checked file the more it matters. Configuration files no longer
  support explain, source, debug, verbose or count.

Bug Fixes

- On Python 2.x, D302 ("Use u""" for Unicode docstrings") is not reported if
  unicode_literals is imported from __future__.

- Fixed a bug where there was no executable for pep257 on Windows.
2015-10-10 13:10:13 +02:00
Florian Bruhin
661f7cde92 Run eslint via tox.
This makes the .travis.yml simpler again and fixes the fact that the exit
status of a command was ignored because of the "|| true".
2015-10-08 06:12:46 +02:00
Florian Bruhin
94d88e280b tox: Add pytest-sugar.
Nicer test output FTW!
2015-10-07 22:13:22 +02:00
Florian Bruhin
2e46efccdc tox: Update pytest to 2.8.2. 2015-10-07 18:14:56 +02:00
Florian Bruhin
52ced6c652 Start Xvfb for tests.
Fixes #851.
2015-10-07 16:54:46 +02:00
Florian Bruhin
b0671ef530 tox: Don't add --faulthandler-timeout to pytest.
This breaks the tests on Windows currently:

https://github.com/pytest-dev/pytest-faulthandler/issues/8
2015-10-07 07:01:03 +02:00
Florian Bruhin
3153f69945 tox: Add pytest-faulthandler for main testenv. 2015-10-07 06:43:50 +02:00
Florian Bruhin
5ecd935ee3 tox: Update six to 1.10.0.
Upstream changelog:

- Improve the performance of `six.int2byte` on Python 3.
- Don't add the `winreg` module to `six.moves` on non-Windows platforms.
- Add `six.moves.getcwd` and `six.moves.getcwdu`.
- Add `create_unbound_method` to create unbound methods.
2015-10-07 06:39:08 +02:00
Florian Bruhin
bdff26a024 tox: Run py35 testenv by default. 2015-10-06 07:10:32 +02:00
Florian Bruhin
98e451c90e Install vulture for pylint testenv. 2015-10-06 07:10:32 +02:00
Florian Bruhin
aa9498bb41 Add separate testenv for vulture. 2015-10-06 07:10:32 +02:00
Florian Bruhin
d7ca469d08 tox: Don't link pyqt for pyroma/check-manifest. 2015-10-06 07:10:32 +02:00
Florian Bruhin
5e958faf29 Add --noconftest flags for some testenvs. 2015-10-06 07:10:32 +02:00
Florian Bruhin
bc26592bb7 tox: Update some environments to pytest 2.8.1.
This works for everything except the main environment which is blocked on the
pytest-catchlog fix.
2015-10-06 07:10:32 +02:00
Florian Bruhin
0a3844a3be tox: Don't set basepython for [testenv].
Otherwise this'd override basepython for any testenv (py34/py35) to use the
installed /usr/bin/python3.

Closes #1001.
2015-10-06 07:10:32 +02:00
Florian Bruhin
fda477397e Get rid of py34-integration testenv.
Fixes #1000.
2015-10-06 07:10:32 +02:00
Florian Bruhin
54557fee20 Fix lint. 2015-10-05 06:53:56 +02:00
Florian Bruhin
6293842c18 Run vulture in misc testenv.
Closes #973.
2015-10-04 23:04:09 +02:00
Florian Bruhin
89e0b96bb6 tox: Update pytest-cov to 2.2.0.
Upstream changelog:

* Added support for changing working directory in tests. Previously changing
  working directory would disable coverage measurements in suprocesses.
* Fixed broken handling for ``--cov-report=annotate``.
2015-10-04 15:50:34 +02:00
Florian Bruhin
0b4dc12869 Use basepython = python3.4 for pylint.
This means users will need PyQt5/sip compiled for Python 3.4, but that's
certainly better than pylint not working at all.
2015-10-04 14:31:54 +02:00
Florian Bruhin
edc74657ad Revert accidental basepython change in tox.ini. 2015-09-30 06:37:00 +02:00
Florian Bruhin
a164eee1ba Hide skip output for unittests-nodisp env. 2015-09-29 21:07:00 +02:00
Florian Bruhin
bb9bd40f6b tox: Update pytest-mock to 0.8.1.
- mock.ANY is also accessible from the mocker fixture
- pytest-mock is now also available as a wheel.
2015-09-29 07:00:18 +02:00
Florian Bruhin
9846011ca7 tox: Update beautifulsoup to 4.4.1.
Upstream changelog:

* Fixed a bug that deranged the tree when part of it was
  removed. Thanks to Eric Weiser for the patch and John Wiseman for a
  test.

* Fixed a parse bug with the html5lib tree-builder. Thanks to Roel
  Kramer for the patch.

* Improved the implementation of CSS selector grouping. Thanks to
  Orangain for the patch.

* Fixed the test_detect_utf8 test so that it works when chardet is
  installed.

* Corrected the output of Declaration objects.
2015-09-29 06:58:37 +02:00
Florian Bruhin
1e5028a7f3 Allow unittests-nodisp to run w/o DISPLAY on CI. 2015-09-28 22:19:33 +02:00
Florian Bruhin
2500b1f759 Add a unittests-nodisp environment. 2015-09-28 21:55:35 +02:00
Florian Bruhin
43a42def2b tox: Update hypothesis to 1.11.4.
- Hide modifications Hypothesis needs to make to sys.path by undoing them after
  we've imported the relevant modules. This is a workaround for issues
  cryptography experienced on windows.
- Slightly improved performance of drawing from sampled_from on large lists of
  alternatives.
- Significantly improved performance of drawing from one_of or strategies using
  | (note this includes a lot of strategies internally - floats() and
  integers() both fall into this category). There turned out to be a massive
  performance regression introduced in 1.10.0 affecting these which probably
  would have made tests using Hypothesis significantly slower than they should
  have been.
2015-09-27 20:51:36 +02:00
Florian Bruhin
a9144cdd21 tox: Update hypothesis to 1.11.3
- Better argument validation for datetimes() strategy - previously setting
  max_year < datetime.MIN_YEAR or min_year > datetime.MAX_YEAR would not have
  raised an InvalidArgument error and instead would have behaved confusingly.
- Compatibility with being run on pytest < 2.7 (achieved by disabling the
  plugin).
2015-09-23 19:08:30 +02:00
Florian Bruhin
a76d9a5914 tox: Update hypothesis to 1.11.2.
Bug fixes:

- Settings(database=my_db) would not be correctly inherited when used as a
  default setting, so that newly created settings would use the database_file
  setting and create an SQLite example database.
- Settings.default.database = my_db would previously have raised an error and
  now works.
- Timeout could sometimes be significantly exceeded if during simplification
  there were a lot of examples tried that didn't trigger the bug.
- When loading a heavily simplified example using a basic() strategy from the
  database this could cause Python to trigger a recursion error.
- Remove use of deprecated API in pytest plugin so as to not emit warning

Misc:

- hypothesis-pytest is now part of hypothesis core. This should have no
  externally visible consequences, but you should update your dependencies to
  remove hypothesis-pytest and depend on only Hypothesis.
- Better repr for hypothesis.extra.datetimes() strategies.
- Add .close() method to abstract base class for Backend (it was already
  present in the main implemnetation).
2015-09-23 18:27:33 +02:00
Florian Bruhin
cbc0721906 tox: Update coverage.py to 4.0.0.
Changelog:

Backward incompatibilities:

- Python versions supported are now:
  - CPython 2.6, 2.7, 3.3, 3.4 and 3.5
  - PyPy2 2.4, 2.6
  - PyPy3 2.4
- The original command line switches (-x to run a program, etc) are no longer
  supported.
- The COVERAGE_OPTIONS environment variable is no longer supported. It was a
  hack for --timid before configuration files were available.
- The original module-level function interface to coverage.py is no longer
  supported. You must now create a coverage.Coverage object, and use methods on
  it.
- The Coverage.use_cache method is no longer supported.
- The private method Coverage._harvest_data is now called Coverage.get_data(),
  and returns the CoverageData containing the collected data.
- Coverage.py is now licensed under the Apache 2.0 license. See NOTICE.txt for
  details.
- Coverage.py kits no longer include tests and docs. If you were using them,
  get in touch and let me know how.

Major new features:

- Plugins: third parties can write plugins to add file support for non-Python
  files, such as web application templating engines, or languages that compile
  down to Python. See Plugins for how to use plugins, and Plugin classes for
  details of how to write them. A plugin for measuring Django template coverage
  is available: django_coverage_plugin
- Gevent, eventlet, and greenlet are now supported. The [run] concurrency
  setting, or the --concurrency command line switch, specifies the concurrency
  library in use. Huge thanks to Peter Portante for initial implementation, and
  to Joe Jevnik for the final insight that completed the work.
- The data storage has been re-written, using JSON instead of pickle. The
  CoverageData class is a new supported API to the contents of the data file.
  Data files from older versions of coverage.py can be converted to the new
  format with python -m coverage.pickle2json.
- Wildly experimental: support for measuring processes started by the
  multiprocessing module. To use, set --concurrency=multiprocessing, either on
  the command line or in the .coveragerc file. Thanks, Eduardo Schettino.
  Currently, this does not work on Windows.

New features:

- Options are now also read from a setup.cfg file, if any. Sections are
  prefixed with “coverage:”, so the [run] options will be read from the
  [coverage:run] section of setup.cfg.
- The HTML report now has filtering. Type text into the Filter box on the index
  page, and only modules with that text in the name will be shown. Thanks,
  Danny Allen.
- A new option: coverage report --skip-covered (or [report] skip_covered) will
  reduce the number of files reported by skipping files with 100% coverage.
  Thanks, Krystian Kichewko. This means that empty __init__.py files will be
  skipped, since they are 100% covered.
- You can now specify the --fail-under option in the .coveragerc file as the
  [report] fail_under option.
- The report -m command now shows missing branches when reporting on branch
  coverage. Thanks, Steve Leonard.
- The coverage combine command now accepts any number of directories or files
  as arguments, and will combine all the data from them. This means you don’t
  have to copy the files to one directory before combining. Thanks, Christine
  Lytwynec.
- A new configuration option for the XML report: [xml] package_depth controls
  which directories are identified as packages in the report. Directories
  deeper than this depth are not reported as packages. The default is that all
  directories are reported as packages. Thanks, Lex Berezhny.
- A new configuration option, [run] note, lets you set a note that will be
  stored in the runs section of the data file. You can use this to annotate the
  data file with any information you like.
- The COVERAGE_DEBUG environment variable can be used to set the [run] debug
  configuration option to control what internal operations are logged.
- A new version identifier is available, coverage.version_info, a plain tuple
  of values similar to sys.version_info.

Improvements:

- Coverage.py now always adds the current directory to sys.path, so that
  plugins can import files in the current directory.
- Coverage.py now accepts a directory name for coverage run and will run a
  __main__.py found there, just like Python will. Thanks, Dmitry Trofimov.
- The --debug switch can now be used on any command.
- Reports now use file names with extensions. Previously, a report would
  describe a/b/c.py as “a/b/c”. Now it is shown as “a/b/c.py”. This allows for
  better support of non-Python files.
- Missing branches in the HTML report now have a bit more information in the
  right-hand annotations. Hopefully this will make their meaning clearer.
- The XML report now contains a <source> element. Thanks Stan Hu.
- The XML report now includes a missing-branches attribute. Thanks, Steve Peak.
  This is not a part of the Cobertura DTD, so the XML report no longer
  references the DTD.
- The XML report now reports each directory as a package again. This was a bad
  regression, I apologize.
- In parallel mode, coverage erase will now delete all of the data files.
- A new warning is possible, if a desired file isn’t measured because it was
  imported before coverage.py was started.
- The coverage.process_startup() function now will start coverage measurement
  only once, no matter how many times it is called. This fixes problems due to
  unusual virtualenv configurations.
- Unrecognized configuration options will now print an error message and stop
  coverage.py. This should help prevent configuration mistakes from passing
  silently.

API changes:

- The class defined in the coverage module is now called Coverage instead of
  coverage, though the old name still works, for backward compatibility.
- You can now programmatically adjust the configuration of coverage.py by
  calling Coverage.set_option() after construction. Coverage.get_option() reads
  the configuration values.
- If the config_file argument to the Coverage constructor is specified as
  ”.coveragerc”, it is treated as if it were True. This means setup.cfg is also
  examined, and a missing file is not considered an error.

Bug fixes:

- The textual report and the HTML report used to report partial branches
  differently for no good reason. Now the text report’s “missing branches”
  column is a “partial branches” column so that both reports show the same
  numbers. This closes issue 342.
- The fail-under value is now rounded the same as reported results, preventing
  paradoxical results, fixing issue 284.
- Branch coverage couldn’t properly handle certain extremely long files. This
  is now fixed, closing issue 359.
- Branch coverage didn’t understand yield statements properly. Mickie Betz
  persisted in pursuing this despite Ned’s pessimism. Fixes issue 308 and issue
  324.
- Files with incorrect encoding declaration comments are no longer ignored by
  the reporting commands.
- Empty files are now reported as 100% covered in the XML report, not 0%
  covered.
- The XML report will now create the output directory if need be. Thanks, Chris
  Rose.
- HTML reports no longer raise UnicodeDecodeError if a Python file has
  undecodable characters.
- The annotate command will now annotate all files, not just ones relative to
  the current directory.
2015-09-21 07:16:37 +02:00
Florian Bruhin
6a8c1e62b7 tox: Update pyflakes to 1.0.0.
Changes:

- Don't mark shadowing variable as 'used'.
- Test that used variable in loop is considered used
- Don't report UnusedImport when binding global name
- Support Python 3.5 async/await statements for Pyflakes.
- Use os.linesep for Windows compatibility
- os.chmod() supports only read-only flag operations on Windows
2015-09-21 07:15:48 +02:00
Florian Bruhin
977bfb4c73 tox: Filter pytest to <2.8.0 for requires.io.
We'll have to wait for hypothesis-pytest and pytest-capturelog/catchlog to be
fixed first.
2015-09-21 07:14:37 +02:00
Florian Bruhin
7d6c39d64b Run frozen smoke test via pytest. 2015-09-18 22:23:18 +02:00
Florian Bruhin
2cb1f9226a Make httpbin tests run when frozen. 2015-09-17 21:51:09 +02:00
Florian Bruhin
4adce826b0 tox: Fix substitution. 2015-09-17 20:03:47 +02:00
Florian Bruhin
7e84a1a5b8 Fix lint. 2015-09-17 20:02:39 +02:00
Florian Bruhin
01f424fdb0 tox: Update pytest-flakes to 1.0.1.
Changelog:

- make the data json clean so we can support modern pytest
2015-09-17 19:03:43 +02:00
Florian Bruhin
929957c4fb tox: Update dependencies for httpbin tests. 2015-09-17 19:02:03 +02:00
Florian Bruhin
48b599a774 Start work on httpbin integration tests. 2015-09-17 19:02:03 +02:00
Florian Bruhin
db513aa956 tox: Require all testenv deps for pylint. 2015-09-17 19:00:49 +02:00
Florian Bruhin
28f34b76af tox: Update hypothesis to 1.11.1.
Bug fixes:

- When running Hypothesis tests in parallel (e.g. using pytest-xdist) there was
  a race condition caused by code generation.
- Example databases are now cached per thread so as to not use sqlite
  connections from multiple threads. This should make Hypothesis now entirely
  thread safe.
- floats() with only min_value or max_value set would have had a very bad
  distribution.
- Running on 3.5, Hypothesis would have emitted deprecation warnings because of
  use of inspect.getargspec
2015-09-16 22:14:24 +02:00
Florian Bruhin
55cf8516e5 tox: Update pytest-qt to 1.7.0.
Upstream changelog:

- PYTEST_QT_API can now be set to pyqt4v2 in order to use version 2 of the
  PyQt4 API.
2015-09-16 17:46:32 +02:00
Florian Bruhin
47b75e1cdc tox: Update pytest to 2.7.3.
Changelog:

- Allow 'dev', 'rc', or other non-integer version strings in `importorskip`.
  Thanks to Eric Hunsberger for the PR.

- fix issue856: consider --color parameter in all outputs (for example
  --fixtures). Thanks Barney Gale for the report and Bruno Oliveira for the PR.

- fix issue855: passing str objects as `plugins` argument to pytest.main
  is now interpreted as a module name to be imported and registered as a
  plugin, instead of silently having no effect.
  Thanks xmo-odoo for the report and Bruno Oliveira for the PR.

- fix issue744: fix for ast.Call changes in Python 3.5+.  Thanks
  Guido van Rossum, Matthias Bussonnier, Stefan Zimmermann and
  Thomas Kluyver.

- fix issue842: applying markers in classes no longer propagate this markers
  to superclasses which also have markers.
  Thanks xmo-odoo for the report and Bruno Oliveira for the PR.

- preserve warning functions after call to pytest.deprecated_call. Thanks
  Pieter Mulder for PR.

- fix issue854: autouse yield_fixtures defined as class members of
  unittest.TestCase subclasses now work as expected.
  Thannks xmo-odoo for the report and Bruno Oliveira for the PR.

- fix issue833: --fixtures now shows all fixtures of collected test files, instead of just the
  fixtures declared on the first one.
  Thanks Florian Bruhin for reporting and Bruno Oliveira for the PR.

- fix issue863: skipped tests now report the correct reason when a skip/xfail
  condition is met when using multiple markers.
  Thanks Raphael Pierzina for reporting and Bruno Oliveira for the PR.

- optimized tmpdir fixture initialization, which should make test sessions
  faster (specially when using pytest-xdist). The only visible effect
  is that now pytest uses a subdirectory in the $TEMP directory for all
  directories created by this fixture (defaults to $TEMP/pytest-$USER).
  Thanks Bruno Oliveira for the PR.
2015-09-15 22:34:47 +02:00
Florian Bruhin
f1ce6d0ed6 tox: Remove unittests-watch env. 2015-09-15 13:19:22 +02:00
Florian Bruhin
7a32bbd955 tox: Reduce dependencies for cxfreeze-windows. 2015-09-11 19:43:29 +02:00
Florian Bruhin
e2c07d3cef tox: Update pytest-qt to 1.6.0.
- Reduced verbosity when exceptions are captured in virtual methods.

- `pytestqt.plugin` has been split in several files and tests have been
  moved out of the `pytestqt` package. This should not affect users, but it
  is worth mentioning nonetheless.

- `QApplication.processEvents()` is now called before and after other fixtures
  and teardown hooks, to better try to avoid non-processed events from leaking
  from one test to the next.

- Show Qt/PyQt/PySide versions in pytest header.

- Disconnect SignalBlocker functions after its loop exits to ensure second
  emissions that call the internal functions on the now-garbage-collected
  SignalBlocker instance.
2015-09-11 07:35:29 +02:00
Florian Bruhin
c4828cf67c tox: Update hypothesis-pytest to 0.18.1.
- Remove deprecated entry point
2015-09-11 07:34:40 +02:00
Florian Bruhin
0ec9efcdc0 tox: Update pytest-html to 1.6.
Changelog:

Preserve environment details when using pytest-xdist.
2015-09-09 08:00:18 +02:00
Florian Bruhin
b23ca85b37 Set basepython for all envs in tox.ini. 2015-09-01 08:54:53 +02:00
Florian Bruhin
0b911d2e20 Split integration tests, run smoke via pytest. 2015-09-01 08:54:53 +02:00
Florian Bruhin
fecc4be057 tox: Update hypothesis to 0.18.0.
Changelog:

- text() with a non-string alphabet would have used the repr() of the the
  alphabet instead of its contexts. This is obviously silly. It now works with
  any sequence of things convertible to unicode strings.

- @given will now work on methods whose definitions contains no explicit
  positional arguments, only varargs. This may have some knock on effects
  because it means that @given no longer changes the argspec of functions other
  than by adding defaults.

- Introduction of new @composite feature for more natural definition of
  strategies you'd previously have used flatmap for.
2015-08-31 21:03:13 +02:00
Florian Bruhin
29e5726101 tox: Update hypothesis to 1.10.6.
Changelog:

Fix support for fixtures on Django 1.7.
2015-08-26 20:41:01 +02:00
Florian Bruhin
57918b651f tox: Remove cov-core. 2015-08-26 17:31:07 +02:00
Florian Bruhin
a981688509 tox: Always generate HTML coverage report. 2015-08-25 17:59:36 +02:00
Florian Bruhin
ece2786d40 tox: Update pytest-cov to 2.1.0.
Changelog:

- Added support for coverage 4.0b2.
- Added the --cov-append command line option.
2015-08-23 17:57:37 +02:00
Florian Bruhin
ab04ca4f36 tox: Update hypothesis to 1.10.5. 2015-08-22 23:45:29 +02:00
Florian Bruhin
92facb6f50 tox: Update hypothesis to 1.10.3.
Upstream changelog:

* lists(elements, unique_by=some_function, min_size=n) would have raised a
  ValidationError if n > Settings.default.average_list_length because it would
  have wanted to use an average list length shorter than the minimum size of
  the list, which is impossible. Now it instead defaults to twice the minimum
  size in these circumstances.
* basic() strategy would have only ever produced at most ten distinct values
  per run of the test (which is bad if you e.g. have it inside a list). This
  was obviously silly. It will now produce a much better distribution of data,
  both duplicated and non duplicated.
* star imports from hypothesis should now work correctly.
* example quality for examples using flatmap will be better, as the way it had
  previously been implemented was causing problems where Hypothesis was
  erroneously labelling some examples as being duplicates.
2015-08-19 21:24:22 +02:00
Florian Bruhin
3b747d91d2 tox: Update pytest-html to 1.5.1.
Changelog:

* Make environment fixture session scoped to avoid repeating content
* Improve string formatting
* Replace custom hook with fixture for setting environment section
2015-08-18 17:41:35 +02:00
Florian Bruhin
8450093de0 Install BeautifulSoup4 for tests. 2015-08-13 21:56:22 +02:00
Florian Bruhin
72e5df0d57 tox: Update pytest-html to 1.4.
Changelog:

* Drop support for pytest < 2.6
* Mention support for PyPy3 in README
* Fix unencodable strings for Python 3.
2015-08-12 18:24:13 +02:00
Florian Bruhin
83a4451f93 Skip coverage checks when tests are filtered. 2015-08-12 06:42:05 +02:00