Commit Graph

148 Commits

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