Commit Graph

125 Commits

Author SHA1 Message Date
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