Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.1.0 #5748

Merged
merged 104 commits into from
Aug 16, 2019
Merged

Release 5.1.0 #5748

merged 104 commits into from
Aug 16, 2019

Conversation

nicoddemus
Copy link
Member

No description provided.

asottile and others added 30 commits June 28, 2019 20:22
It is no longer deprecated, but part of the normal code for 'config'
Those are not really deprecated anymore and are part of the normal
code for config
This is no longer a deprecation so it makes sense to move it
to the place where it is needed instead of leaving it in deprecated.py
Hopefully by Python 3.9 this will be fixed upstream, if not we will
need to bump the version again.

Fix pytest-dev#5523
…est-dev#5539)

Replace importlib_metadata with importlib.metadata on Python 3.8+
These attributes can be used to access the unchanged arguments passed
to pytest.main().

The intention is to use these attributes to initialize workers in
the same manner as the master node is initialized in pytest-xdist.
…rences

When enabled, floating-point numbers only need to match as far as the
precision you have written in the expected doctest output. This avoids
false positives caused by limited floating-point precision, like this:

    Expected:
        0.233
    Got:
        0.23300000000000001

This is inspired by Sébastien Boisgérault's [numtest] but the
implementation is a bit different:

* This implementation edits the literals that are in the "got"
  string (the actual output from the expression being tested), and then
  proceeds to compare the strings literally. This is similar to pytest's
  existing ALLOW_UNICODE and ALLOW_BYTES implementation.

* This implementation only compares floats against floats, not ints
  against floats. That is, the following doctest will fail with pytest
  whereas it would pass with numtest:

      >>> math.py  # doctest: +NUMBER
      3

  This behaviour should be less surprising (less false negatives) when
  you enable NUMBER globally in pytest.ini.

Advantages of this implementation compared to numtest:

* Doesn't require `import numtest` at the top level of the file.
* Works with pytest (if you try to use pytest & numtest together, pytest
  raises "TypeError: unbound method check_output() must be called with
  NumTestOutputChecker instance as first argument (got
  LiteralsOutputChecker instance instead)").
* Works with Python 3.

[numtest]: https://github.com/boisgera/numtest
* Move the parts about "how to configure it" (pytest.ini vs. inline
  comment) together.
* Move `--doctest-continue-on-failure` into its own sub-heading, as it
  isn't related to the doctest optionflags.
Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.

This enables:

- Progressively adding type annotations and enabling more strict
  options, which will improve the codebase (IMO).

- Annotating the public API in-line, and eventually exposing it to
  library users who use type checkers (with a py.typed file).

Though, none of this is done yet.

Refs pytest-dev#3342.
nicoddemus and others added 25 commits August 9, 2019 10:55
Apperently it does not hang, let's see how it fares on CI
Validate xunit2 files against the schema
Remove unused function CallSpec2.setall
This creates a separate section from 'features' for small changes which
don't usually require user intervention, such as:

* Human readable session duration
* New junitxml fields
* Improved colors in terminal
* etc.

The idea is to better match user expectations about new actual
features in the "Features" section of the changelog.
…elog

Add new 'improvement' changelog category
Show session duration in human-readable format
Previously it would say:

    > assert '123456789012...901234567890A' == '1234567890123...901234567890B'"

This makes it look like the "3" might be different already.

This is clearer, and it is OK to have potentially one less char in the
right one:

    > assert '123456789012...901234567890A' == '123456789012...901234567890B'"
`ast.parse("None")` was added/used in 3e6f1fa for differences between
Python 2/3, but we do not support py2 anymore.
assertion.rewrite: use ast.NameConstant(None) directly
Publish GitHub release notes after deployment
pytester: spawn: skip without pexpect.spawn
I was doing final tests on the script today, and forgot to change
the hardecoded "pytest-dev/pytest", which ended up publishing a
`4.99.10` release to the main repository by mistake, as my token
has access to both my fork and main repository.

I deleted the tag immeditely just a few seconds later, so hopefully
this won't cause major problems.

This change makes it safer to test this in the future, never publishing
to the main repository by mistake (as long as the tags are pushed to the
right repositories of course).
Use TRAVIS_REPO_SLUG instead of hard-coding pytest-dev/pytest
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise looks good

@nicoddemus nicoddemus merged commit 8ccc017 into pytest-dev:master Aug 16, 2019
@nicoddemus nicoddemus deleted the release-5.1.0 branch August 16, 2019 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants