Commit Graph

477 Commits

Author SHA1 Message Date
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
Florian Bruhin
6b6bceeb3a tox: Run all tests in one step.
This partially reverts 14545a3 - this didn't play nice with HTML and other
things.
2015-08-11 21:05:20 +02:00
Florian Bruhin
14545a3a22 Mark some tests as integration and no coverage. 2015-08-11 19:36:27 +02:00
Florian Bruhin
dc2b3ff433 tox: Update hypothesis-pytest to 0.17.0.
Changelog:

- Mark tests with 'hypothesis' if they use hypothesis.
2015-08-11 19:35:59 +02:00
Florian Bruhin
2fe1bcfc2b Skip GUI tests when no DISPLAY is available.
Fixes #851.
2015-08-09 22:45:24 +02:00
Florian Bruhin
0bf651d1fa tox: Don't run smoke environment. 2015-08-09 11:35:34 +02:00
Florian Bruhin
409b32122e Don't generate HTML coverage by default. 2015-08-08 22:55:13 +02:00
Florian Bruhin
3179455e69 Reorganize tox.ini.
- The environment to run unittests is now called py34 as that's the common
  thing used, and will also allow us to run the tests with Python 3.5.
- The default tests now also run coverage.py and do a coverage check (on
  Linux).
- The smoke tests are now part of the default environment.
2015-08-08 22:33:29 +02:00
Florian Bruhin
f6c1d355e3 Pass $HOME to misc testenv.
Fixes #860.
2015-08-08 14:46:23 +02:00
Florian Bruhin
cdd53a4515 tox: Set PYTEST_QT_API. 2015-08-07 06:38:12 +02:00
Florian Bruhin
8ac48699f2 tox: Update hypothesis/hypothesis-pytest. 2015-08-04 12:00:23 +02:00
Florian Bruhin
c4183bc34d tox: Update hypothesis/hypothesis-pytest to 1.10.0
This is just a bugfix and performance release, but it changes some semi-public
APIs, hence the minor version bump.

- Significant performance improvements for strategies which are one_of() many
  branches. In particular this included recursive() strategies. This should
  take the case where you use one recursive() strategy as the base strategy of
  another from unusably slow (tens of seconds per generated example) to
  reasonably fast.
- Better handling of just() and sampled_from() for values which have an
  incorrect __repr__ implementation that returns non-ASCII unicode on Python 2.
- Better performance for flatmap from changing the internal morpher API to be
  significantly less general purpose.
- Introduce a new semi-public BuildContext/cleanup API. This allows strategies
  to register cleanup activities that should run once the example is complete.
  Note that this will interact somewhat weirdly with find.
- Better simplification behaviour for streaming strategies.
- Don't error on lambdas which use destructuring arguments in Python 2.
- Add some better reprs for a few strategies that were missing good ones.
- The Random instances provided by randoms() are now copyable.
- Slightly more debugging information about simplify when using a debug
  verbosity level.
- Support using given for functions with varargs, but not passing arguments to
  it as positional.
2015-08-03 23:40:39 +02:00
Florian Bruhin
030678602a tox: Update astroid to 1.3.8.
Changelog:

Filter out YES nodes when creating a temporary class for the with_metaclass
hack.

Having an YES node in a class bases will lead to a crash with a TypeError
when trying to obtain the ancestors of the given class, because .ancestors()
will try to iterate each inferred node from the bases, thus will try to
iterate over an YES node.
2015-08-03 10:38:42 +02:00
Florian Bruhin
b93b32c92f tox: Ignore test modules for pep257. 2015-08-02 22:16:03 +02:00
Florian Bruhin
edf431f541 tox: Update pytest-qt to 1.5.1.
Upstream changelog:

Exceptions are now captured also during test tear down, as delayed events will
get processed then and might raise exceptions in virtual methods; this is
specially problematic in PyQt5.5, which changed the behavior to call abort by
default, which will crash the interpreter.
2015-08-01 21:42:04 +02:00
Florian Bruhin
daa6f8276f tox: Update pytest-html to 1.3.2.
Changelog:

* Always include log but only display additional row if log has content or
  there's additional HTML
2015-07-29 17:03:30 +02:00
Florian Bruhin
7830e40cce tox: Update pytest-cov to 2.0.0.
Changelog:

* Added --cov-fail-under, akin to the new fail_under option in coverage-4.0
  (automatically activated if there's a [report] fail_under = ... in
  .coveragerc).
* Changed --cov-report=term to automatically upgrade to
  --cov-report=term-missing if there's [run] show_missing = True in
  .coveragerc.
* Changed --cov so it can be used with no path argument (in wich case the
  source settings from .coveragerc will be used instead).
* Fixed .pth installation to work in all cases (install, easy_install, wheels,
  develop etc).
* Fixed .pth uninstallation to work for wheel installs.
* Support for coverage 4.0.
* Data file suffixing changed to use coverage's data_suffix=True option
  (instead of the custom suffixing).
* Avoid warning about missing coverage data (just like
  coverage.control.process_startup).
* Fixed a race condition when running with xdist (all the workers tried to
  combine the files). It's possible that this issue is not present in
  pytest-cov 1.8.X.
2015-07-29 17:02:15 +02:00
Florian Bruhin
8be69e2f41 tox: Update hypothesis/-pytest to 1.9.0/0.14.0.
Changelog:

Codename: The great bundling.

This release contains two fairly major changes.

The first is the deprecation of the hypothesis-extra mechanism. From now on all
the packages that were previously bundled under it other than hypothesis-pytest
(which is a different beast and will remain separate). The functionality
remains unchanged and you can still import them from exactly the same location,
they just are no longer separate packages.

The second is that this introduces a new way of building strategies which lets
you build up strategies recursively from other strategies.

It also contains the minor change that calling .example() on a strategy object
will give you examples that are more representative of the actual data you'll
get. There used to be some logic in there to make the examples artificially
simple but this proved to be a bad idea.
2015-07-29 16:59:51 +02:00
Florian Bruhin
418c7e4a96 tox: Update astroid to 1.3.7.
Changelog:

Improved handling of the six package.
2015-07-29 16:55:53 +02:00
Florian Bruhin
d0f1523363 tox: Update hypothesis to 1.8.5. 2015-07-24 19:15:07 +02:00
Florian Bruhin
694fbe053d Fix lint. 2015-07-24 18:11:52 +02:00
Florian Bruhin
ebdfa0be73 Add hypothesis tests for configtypes.
See #830.
2015-07-24 17:49:09 +02:00
Florian Bruhin
d805e2d71e Don't use lxml for check_coverage.py.
See #792.
2015-07-24 14:42:18 +02:00
Florian Bruhin
7f2abd1a46 tests: Enforce 100% coverage for perfect modules.
Fixes #792.
2015-07-24 14:04:40 +02:00
Florian Bruhin
5e58d814d7 tox: Add a unittests-watch environment. 2015-07-23 11:31:51 +02:00
Florian Bruhin
e81ac925d7 tox: Adjust pep257 comment. 2015-07-21 10:26:57 +02:00
Florian Bruhin
0b8c054dc1 tox: Update pep257 to 0.6.0
Upstream changelog:

New Features

* Added support for more flexible error selections using --ignore, --select,
  --convention, --add-ignore and --add-select (#96, #123).

Bug Fixes

* Property setter and deleter methods are now treated as private and do not
  require docstrings separate from the main property method (#69, #107).

* Fixed an issue where pep257 did not accept docstrings that are both
  unicode and raw in Python 2.x (#116, #119).

* Fixed an issue where Python 3.x files with Unicode encodings were
  not read correctly (#118).
2015-07-21 10:21:48 +02:00
Florian Bruhin
474255cbe7 Move pytest options to pytest.ini. 2015-07-19 21:56:09 +02:00
Florian Bruhin
43500b2e24 tox: Fix posargs handling for tests. 2015-07-19 21:54:51 +02:00
Florian Bruhin
4905cfc7a5 tox: Update logilab-common to 1.0.2.
Upstream changelog:

* declare setuptools requirement in __pkginfo__/setup.py
* randomize order of test modules in pytest -t
2015-07-10 12:00:26 +02:00
Florian Bruhin
dbef785a94 tox: Update pytest-mock to 0.7.0. 2015-07-08 07:14:22 +02:00
Florian Bruhin
de91142880 tox: Add path to tests. 2015-07-06 18:50:34 +02:00
Florian Bruhin
d232437105 Update to beautifulsoup 4.4.0.
Upstream changelog:

Especially important changes:

* Added a warning when you instantiate a BeautifulSoup object without
  explicitly naming a parser. [bug=1398866]

* __repr__ now returns an ASCII bytestring in Python 2, and a Unicode
  string in Python 3, instead of a UTF8-encoded bytestring in both
  versions. In Python 3, __str__ now returns a Unicode string instead
  of a bytestring. [bug=1420131]

* The `text` argument to the find_* methods is now called `string`,
  which is more accurate. `text` still works, but `string` is the
  argument described in the documentation. `text` may eventually
  change its meaning, but not for a very long time. [bug=1366856]

* Changed the way soup objects work under copy.copy(). Copying a
  NavigableString or a Tag will give you a new NavigableString that's
  equal to the old one but not connected to the parse tree. Patch by
  Martijn Peters. [bug=1307490]

* Started using a standard MIT license. [bug=1294662]

* Added a Chinese translation of the documentation by Delong .w.

New features:

* Introduced the select_one() method, which uses a CSS selector but
  only returns the first match, instead of a list of
  matches. [bug=1349367]

* You can now create a Tag object without specifying a
  TreeBuilder. Patch by Martijn Pieters. [bug=1307471]

* You can now create a NavigableString or a subclass just by invoking
  the constructor. [bug=1294315]

* Added an `exclude_encodings` argument to UnicodeDammit and to the
  Beautiful Soup constructor, which lets you prohibit the detection of
  an encoding that you know is wrong. [bug=1469408]

* The select() method now supports selector grouping. Patch by
  Francisco Canas [bug=1191917]

Bug fixes:

* Fixed yet another problem that caused the html5lib tree builder to
  create a disconnected parse tree. [bug=1237763]

* Force object_was_parsed() to keep the tree intact even when an element
  from later in the document is moved into place. [bug=1430633]

* Fixed yet another bug that caused a disconnected tree when html5lib
  copied an element from one part of the tree to another. [bug=1270611]

* Fixed a bug where Element.extract() could create an infinite loop in
  the remaining tree.

* The select() method can now find tags whose names contain
  dashes. Patch by Francisco Canas. [bug=1276211]

* The select() method can now find tags with attributes whose names
  contain dashes. Patch by Marek Kapolka. [bug=1304007]

* Improved the lxml tree builder's handling of processing
  instructions. [bug=1294645]

* Restored the helpful syntax error that happens when you try to
  import the Python 2 edition of Beautiful Soup under Python
  3. [bug=1213387]

* In Python 3.4 and above, set the new convert_charrefs argument to
  the html.parser constructor to avoid a warning and future
  failures. Patch by Stefano Revera. [bug=1375721]

* The warning when you pass in a filename or URL as markup will now be
  displayed correctly even if the filename or URL is a Unicode
  string. [bug=1268888]

* If the initial <html> tag contains a CDATA list attribute such as
  'class', the html5lib tree builder will now turn its value into a
  list, as it would with any other tag. [bug=1296481]

* Fixed an import error in Python 3.5 caused by the removal of the
  HTMLParseError class. [bug=1420063]

* Improved docstring for encode_contents() and
  decode_contents(). [bug=1441543]

* Fixed a crash in Unicode, Dammit's encoding detector when the name
  of the encoding itself contained invalid bytes. [bug=1360913]

* Improved the exception raised when you call .unwrap() or
  .replace_with() on an element that's not attached to a tree.

* Raise a NotImplementedError whenever an unsupported CSS pseudoclass
  is used in select(). Previously some cases did not result in a
  NotImplementedError.

* It's now possible to pickle a BeautifulSoup object no matter which
  tree builder was used to create it. However, the only tree builder
  that survives the pickling process is the HTMLParserTreeBuilder
  ('html.parser'). If you unpickle a BeautifulSoup object created with
  some other tree builder, soup.builder will be None. [bug=1231545]
2015-07-06 10:49:59 +02:00
Florian Bruhin
2643975c3c tox: Update logilab-common to 1.0.1. 2015-07-02 21:05:48 +02:00
Florian Bruhin
ec1476da2e tox: Update pylint and logilab-common.
pylint changelog:

- Support for logilab-common 1.0.0

logilab-common changelog:

- remove unused/deprecated modules: cli, contexts, corbautils, dbf, pyro_ext,
  xmlrpcutils. __pkginfo__ is no longer installed.
- major layout change
- use setuptools exclusively
- 'logilab' is now a proper namespace package
- modutils: basic support for namespace packages
- registry: ambiguous selects now raise a specific exception
- testlib: better support for non-pytest launchers
- testlib: Tags() now work with py3k
2015-06-30 20:50:12 +02:00
Florian Bruhin
e6655cf66d tox: Add requirements.io filter for logilab-common.
pylint is broken with logilab-common=1.0.0 currently:

https://bitbucket.org/logilab/pylint/issue/575/support-for-logilabcommon-100
2015-06-30 17:58:53 +02:00
Florian Bruhin
616c842f2f tox: Update pytest-qt to 1.5.0.
Upstream changelog:

* Fixed log line number in messages, and provide better contextual information
  in Qt5 (#55, thanks @The-Compiler);
* Fixed issue where exceptions inside a `waitSignals` or `waitSignal`
  with-statement block would be swallowed and a `SignalTimeoutError` would be
  raised instead. (#59, thanks @The-Compiler for bringing up the issue and
  providing a test case);
* Fixed issue where the first usage of `qapp` fixture would return `None`.
  Thanks to @gqmelo for noticing and providing a PR;
* New `qtlog` now sports a context manager method, `disabled` (#58). Thanks
  @The-Compiler for the idea and testing;
2015-06-29 23:16:42 +02:00
Florian Bruhin
b673c39b62 tox: Fix script path for docs env. 2015-06-28 23:04:18 +02:00
Florian Bruhin
9b264c7514 tests: Share common markers. 2015-06-28 22:58:48 +02:00
Florian Bruhin
be3f61af62 Move developer scripts to dev/ subfolder.
Closes #783.
2015-06-28 22:31:30 +02:00
Florian Bruhin
93f5e30a00 tox: Whoops, update all py-lines. 2015-06-26 22:41:30 +02:00
Florian Bruhin
086010d81e tox: Update py (pylib) to 1.4.30.
Upstream changelog:

fix issue68 an assert with a multiline list comprehension was not reported
correctly. Thanks Henrik Heibuerger.
2015-06-26 22:38:58 +02:00
Florian Bruhin
3dbf3f9e0a Use tox/virtualenv to build Windows packages.
This makes sure we have all needed dependencies installed in the version which
is in requirements.txt.
Fixes #776.
2015-06-23 23:31:28 +02:00
Florian Bruhin
d02b63a847 tox: Use --ignore=tests for pep8/pyflakes/mccabe. 2015-06-23 18:17:05 +02:00
Florian Bruhin
f2d7391974 tox: Update pytest to 2.7.2 and pylib to 1.4.29.
pytest upstream changelog
=========================

- fix issue767: pytest.raises value attribute does not contain the exception
  instance on Python 2.6. Thanks Eric Siegerman for providing the test
  case and Bruno Oliveira for PR.

- Automatically create directory for junitxml and results log.
  Thanks Aron Curzon.

- fix issue713: JUnit XML reports for doctest failures.
  Thanks Punyashloka Biswal.

- fix issue735: assertion failures on debug versions of Python 3.4+
  Thanks Benjamin Peterson.

- fix issue114: skipif marker reports to internal skipping plugin;
  Thanks Floris Bruynooghe for reporting and Bruno Oliveira for the PR.

- fix issue748: unittest.SkipTest reports to internal pytest unittest plugin.
  Thanks Thomas De Schampheleire for reporting and Bruno Oliveira for the PR.

- fix issue718: failed to create representation of sets containing unsortable
  elements in python 2. Thanks Edison Gustavo Muenz

- fix issue756, fix issue752 (and similar issues): depend on py-1.4.29
  which has a refined algorithm for traceback generation.

py upstream changelog
=====================

- fix issue55: revert a change to the statement finding algorithm
  which is used by pytest for generating tracebacks.
  Thanks Daniel Hahler for initial analysis.

- fix pytest issue254 for when traceback rendering can't
  find valid source code.  Thanks Ionel Cristian Maries.
2015-06-23 17:19:48 +02:00
Florian Bruhin
fd82587213 Skip documentation when freezing for smoke-frozen. 2015-06-19 09:40:26 +02:00
Florian Bruhin
42b5ee831e Add a unittests-frozen testenv.
See #770.
2015-06-19 09:39:55 +02:00
Florian Bruhin
3ba63128da Add a smoke-frozen testenv.
See #770.
2015-06-19 07:35:01 +02:00
Florian Bruhin
703b0043db tox: Update pyflakes to 0.9.2.
Upstream changelog:

- Fix a traceback when a global is defined in one scope, and used in another.
2015-06-17 17:48:25 +02:00
Florian Bruhin
a024c14dd6 tox: Add smoke test to the default envlist. 2015-06-16 07:37:08 +02:00
Florian Bruhin
b43d8b13d8 tox: Update mccabe to 0.3.1.
Upstream changelog:

- Include test_mccabe.py in releases.
- Always coerce the max_complexity value from Flake8's entry-point to an integer.
2015-06-15 06:21:14 +02:00
Florian Bruhin
8dc9f0562a tox: Update pyroma to 1.8.2.
Upstream changelog:

Do not complain that the version number should be a string, when it is a
basestring. [maurits]
2015-06-14 13:45:09 +02:00
Florian Bruhin
219c2f8ae8 Ignore "Unable to set geometry" warnings in tests.
This reverts commits 9b066ec50a and
83f7cf84a9.

This was still broken even after setting the geometry:

https://ci.appveyor.com/project/The-Compiler/qutebrowser
2015-06-12 17:04:12 +02:00
Florian Bruhin
5a8b7910e0 tox: Use python -m to start pylint.
This makes it also work on Windows, where bin/ is called Scripts/.
2015-06-10 18:35:33 +02:00
Florian Bruhin
67473c6db1 tox: Add PYTHON to passenv. 2015-06-10 18:35:33 +02:00
Florian Bruhin
67e895b6c7 Hide SetProcessDpiAwareness Qt warning.
This shows up on AppVeyor CI for some reason.
See https://bugreports.qt.io/browse/QTBUG-38993
2015-06-10 18:35:33 +02:00
Florian Bruhin
645a1512dd tox: Update pyflakes to 0.9.1. 2015-06-10 06:10:12 +02:00
Florian Bruhin
4532176e7b Don't use substitutions in tox.ini.
These seem to break things on Ubuntu Trusty...
2015-06-09 19:12:19 +02:00
Florian Bruhin
d887623377 Make tests fail on unexpected Qt messages. 2015-06-07 02:34:19 +02:00
Florian Bruhin
a0e5a3e8ee tox: Update pytest-qt to 1.4.0.
Upstream changelog:

- Messages sent by qDebug, qWarning, qCritical are captured and displayed when
  tests fail, similar to pytest-catchlog. Also, tests can be configured to
  automatically fail if an unexpected message is generated. (See docs).
- New method waitSignals: will block untill all signals given are triggered, see
  docs (thanks @The-Compiler for idea and complete PR).
- New parameter raising to waitSignals and waitSignals: when True (defaults to
  False) will raise a qtbot.SignalTimeoutError exception when timeout is reached,
  see docs (thanks again to @The-Compiler for idea and complete PR).
- pytest-qt now requires pytest version >= 2.7.

Internal changes to improve memory management

- QApplication.exit() is no longer called at the end of the test session and
  the QApplication instance is not garbage collected anymore;
- QtBot no longer receives a QApplication as a parameter in the constructor,
  always referencing QApplication.instance() now; this avoids keeping an extra
  reference in the qtbot instances.
- deleteLater is called on widgets added in QtBot.addWidget at the end of each
  test;
- QApplication.processEvents() is called at the end of each test to make sure
  widgets are cleaned up;
2015-06-07 01:24:02 +02:00
Florian Bruhin
fd75f77108 Fix spell checker to check all files. 2015-06-07 01:24:02 +02:00
Florian Bruhin
d3f7d9319a tox: Update py to 1.4.28.
Upstream changelog:

- fix issue64 -- dirpath regression when "abs=True" is passed. Thanks Gilles
  Dartiguelongue.
2015-06-05 17:29:00 +02:00
Florian Bruhin
6ec8bbaca5 tox: Update pytest-mock to 0.6.0.
Upstream changelog:

- Two new auxiliary methods, spy and stub.
2015-06-05 17:27:59 +02:00
Florian Bruhin
e38169433e tox: Update pytest-flakes to 1.0.0.
Upstream changelog:

- Fix issue #6 - support PEP263 for source file encoding.
- Clarified license to be MIT like pytest-pep8 from which this is derived.
2015-06-05 17:26:49 +02:00
Florian Bruhin
4a909aa028 Use pylint's built-in checker to check for CRLF. 2015-06-04 15:25:36 +02:00
Florian Bruhin
36803cba06 Switch from flake8 to pytest-{mccabe,flakes,pep8}. 2015-06-02 20:51:06 +02:00
Florian Bruhin
534dbfc4c2 tox: Update check-manifest to 0.25.
Upstream changelog:

    Stop dynamic computation of install_requires in setup.py: this doesn't work
    well in the presence of the pip 7 wheel cache. Use PEP-426 environment
    markers instead (this means we now require setuptools version 0.7 or
    newer).
2015-05-27 08:51:24 +02:00
Florian Bruhin
6f3fa9dca6 tox: Show more information when testing. 2015-05-27 07:51:53 +02:00
Florian Bruhin
a969fe021d tox: Install requirements.txt for tests. 2015-05-27 07:45:21 +02:00
Florian Bruhin
92abf4bdf8 tox: Update pytest-html to 1.3.1.
Upstream changelog:

1.3.1:

Fix encoding issue in Python 3

1.3:

Bump version number to 1.3
Simplify example in README
Show extra content in report regardless of test result
Support extra content in JSON format
2015-05-26 19:25:45 +02:00
Florian Bruhin
0252f5fdbf tox: Update pytest-html to 1.2. 2015-05-20 13:37:44 +02:00
Florian Bruhin
daaf7a62c8 tox: Update pytest to 2.7.1. 2015-05-19 12:38:13 +02:00
Florian Bruhin
5ef40829aa tox: Pass $USERNAME and $USER for smoke env.
This fixes getpass.getuser() on Windows for the smoke tests.
2015-05-17 18:14:21 +02:00
Florian Bruhin
f17238d3d4 tox: Set QT_QPA_PLATFORM_PLUGIN_PATH for smoke.
This fixes smoke tests on Windows (I think).
2015-05-17 01:19:23 +02:00
Florian Bruhin
b5dc4ea040 tox: Use absolute path for -rrequirements.txt.
This fixes a FileNotFoundError on Ubuntu Trusty.
2015-05-17 01:18:19 +02:00
Florian Bruhin
f54c416ddd tox: Fixes for smoke environment. 2015-05-17 01:07:36 +02:00
Florian Bruhin
3f98bf372e Merge branch 'smoke'
Conflicts:
      doc/qutebrowser.1.asciidoc
      qutebrowser/app.py
      qutebrowser/config/config.py
      qutebrowser/qutebrowser.py
      tox.ini
2015-05-17 00:28:56 +02:00
Florian Bruhin
9be5992a9a Smoke test WIP 2015-05-16 23:43:34 +02:00
Florian Bruhin
4dbc4ba93f tox: Fix QT_QPA_PLATFORM_PLUGIN_PATH.
See 677cfc9410.
2015-05-16 14:22:56 +02:00
Florian Bruhin
dd83a40df4 tox: Set passenv for tox 2.0. 2015-05-16 14:13:24 +02:00
Florian Bruhin
677cfc9410 tox: envsitespackagedir workaround for tox 2.0.1. 2015-05-16 14:12:33 +02:00
Florian Bruhin
18eace37f8 tox: Add pytest-html. 2015-05-10 21:47:05 +02:00
Florian Bruhin
ad822b72c7 tox: Update py to 1.27.
Upstream changelog:

    - fix issue59: point to new repo site

    - allow a new ensuresyspath="append" mode for py.path.local.pyimport()
      so that a neccessary import path is appended instead of prepended to
      sys.path

    - strike undocumented, untested argument to py.path.local.pypkgpath

    - speed up py.path.local.dirpath by a factor of 10
2015-05-07 14:50:32 +02:00
Florian Bruhin
530fe5e933 tox.ini: Update pytest-mock to 0.5.
Changelog:
    Mock and Magic mock are now accessible from the mocker fixture.
2015-05-04 07:47:58 +02:00
Florian Bruhin
1903792239 tox: Update pyroma to 1.8.1.
Changelog:
    - More robust rating. [Jeff Quast]
    - Closed #24. ("pyroma some_pypi_package" fails)
2015-04-27 13:07:57 +02:00
Florian Bruhin
8edfa4281e Revert "tox.ini: Use pytest-qt from git."
This reverts commit 71608af486.
2015-04-24 17:34:10 +02:00
Florian Bruhin
71608af486 tox.ini: Use pytest-qt from git.
See https://github.com/pytest-dev/pytest-qt/pull/38.
2015-04-22 18:12:03 +02:00
Florian Bruhin
1b13b0c385 Add --strict to pytest invocation. 2015-04-20 18:02:59 +02:00
Florian Bruhin
c098d0de37 Register the gui marker in tox.ini. 2015-04-20 18:02:04 +02:00
Florian Bruhin
9111ae7b3c tox: Update pytest-mock to 0.4.3.
Upstream changelog:

- mocker and the backward compatible mock fixture now return the same object.
2015-04-09 13:19:39 +02:00
Florian Bruhin
76651822bd Merge pull request #16 from hackebrot/layout
Adopt test layout to pytest.
2015-04-08 14:03:02 +02:00
Bruno Oliveira
abc2c2b087 Remove spurious dependencies from tox.ini as pointed out by @The-Compiler 2015-04-08 01:06:31 -03:00
Florian Bruhin
9d44f777c0 Fix lint. 2015-04-05 20:30:31 +02:00
Florian Bruhin
d3a92d505c Make lints run with adjusted test folder location.
For pylint we need a custom script; see
https://bitbucket.org/logilab/pylint/issue/512/
2015-04-05 18:45:48 +02:00
Florian Bruhin
ce0b9eab58 tox: Make it possible to pass args to pytest. 2015-04-05 15:39:05 +02:00
Bruno Oliveira
4fa2294805 Merge remote-tracking branch 'origin/master' into layout
Conflicts:
	qutebrowser/test/keyinput/test_basekeyparser.py
	qutebrowser/test/utils/test_standarddir.py
	test/browser/http/test_content_disposition.py
	test/config/test_configtypes.py
	test/misc/test_editor.py
	test/utils/test_debug.py
	test/utils/test_utils.py
	tox.ini
2015-04-04 14:29:49 -03:00
Bruno Oliveira
99abd1edeb Adding pytest-mock to tox 2015-04-03 20:17:52 -03:00
Raphael Pierzina
58a8a7e992 Introduce pytest plugin capturelog and convert test_log_time 2015-04-03 20:10:41 +02:00
Bruno Oliveira
751b62e344 Moving logging and QApplication to conftest
As discussed in #8
2015-04-02 19:09:06 -03:00
Bruno Oliveira
3096f3856a Implemented test for TextBase widget 2015-04-01 20:50:20 -03:00
Florian Bruhin
38c63ca2ea Add a checker for words which I often misspell. 2015-03-31 22:12:38 +02:00
Florian Bruhin
96090b86fd tox: Use pytest-cov for coverage. 2015-03-30 23:36:27 +02:00
Florian Bruhin
36421934f9 tox: Use pytest instead of unittest. 2015-03-30 23:09:35 +02:00
Florian Bruhin
34a0976a6f Fix requirements.io filter. 2015-03-27 19:27:57 +01:00
Florian Bruhin
51141adb24 tox: Better requirements.io filter for pep8. 2015-03-26 21:34:13 +01:00
Florian Bruhin
c562fac9cb tox: Use git directly to check for changes (docs).
We also remove checking for uncommited changes in misc_checks.py, as this
usually just is noise.
2015-03-26 20:37:53 +01:00
Florian Bruhin
16ab2ad167 tox: Add skip_install to more environments. 2015-03-26 20:19:55 +01:00
Florian Bruhin
acb13bb61e tox: Update check-manifest to 0.24.
Changelog:

* Make sure setup.py not being added to the VCS doesn't cause
  hard-to-understand errors (issue #46).
2015-03-26 19:56:29 +01:00
Florian Bruhin
67b9036574 tox: tox.ini fixes for Ubuntu Trusty/tox 1.6
- Don't use old PYTHONPATH in tox.ini.
  PYTHONPATH should be unset anyways, so it's okay to ignore the old value.

- Don't use config interpolation for unittests.
  This shows a "command not found" error for some reason.
2015-03-26 13:23:07 +01:00
Florian Bruhin
cb3fcd3d8a Don't use {envsitepackagesdir} for link_pyqt.py.
It seems this is broken (and passes the global path) on Ubuntu Trusty.
2015-03-26 13:23:07 +01:00
Florian Bruhin
738f6a4510 tox: Set QT_QPA_PLATFORM_PLUGIN_PATH for tests.
This is needed on Windows so the qwindows plugin is found.
It makes more sense to set this here instead of setting it in the buildbot
settings.
2015-03-26 13:23:07 +01:00
Florian Bruhin
b409517777 tox: Use python -m pep257 for pep257. 2015-03-26 13:23:03 +01:00
Florian Bruhin
a1df3194ff tox: Add coverage/docs environments. 2015-03-26 13:21:10 +01:00
Florian Bruhin
1d29e3462f Use tox to manage virtualenvs.
Obsoletes #463.
Fixes #558.
Fixes part of #474.
Closes #479.
Closes #452.
2015-03-26 08:15:38 +01:00