Commit Graph

187 Commits

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