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

fixed a bunch of unicode bugs in pytester.py #3848

Merged
merged 5 commits into from Aug 23, 2018

Conversation

Projects
None yet
4 participants
@wimglenn
Contributor

wimglenn commented Aug 22, 2018

CI for my plugin is failing on 2.7, but when checking in the code I don't think I'm doing anything wrong actually. Look to me like the problem is in pytester.py, so trying to fix it there - don't randomly call str() on args which might be unicode objects (this seems to have been originally done to convert py.path.local instances to ordinary strings, but done a bit over-zealously).

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Aug 22, 2018

Coverage Status

Coverage increased (+0.04%) to 92.638% when pulling 8804c73 on wimglenn:pytester_unicode_bugfixes into 3b521be on pytest-dev:master.

coveralls commented Aug 22, 2018

Coverage Status

Coverage increased (+0.04%) to 92.638% when pulling 8804c73 on wimglenn:pytester_unicode_bugfixes into 3b521be on pytest-dev:master.

@RonnyPfannschmidt

This comment has been minimized.

Show comment
Hide comment
@RonnyPfannschmidt

RonnyPfannschmidt Aug 22, 2018

Member

please add a test demonstrating the issue in order to avoid regressions

Member

RonnyPfannschmidt commented Aug 22, 2018

please add a test demonstrating the issue in order to avoid regressions

wimglenn added some commits Aug 22, 2018

More unicode whack-a-mole
It seems pytest's very comprehensive CI sniffed out a few other places with similar bugs.  Ideally we should find all the places where args are not stringy and solve it at the source, but who knows how many people are relying on the implicit string conversion.  See [here](https://github.com/pytest-dev/pytest/blob/master/src/_pytest/config/__init__.py#L160-L166) for one such problem area (args with a single py.path.local instance is converted here, but a list or tuple containing some are not).
@wimglenn

This comment has been minimized.

Show comment
Hide comment
@wimglenn

wimglenn Aug 22, 2018

Contributor

@RonnyPfannschmidt Think that whacked 'em all for the moment. How is the workflow in pytest-dev, should I rebase and squash/force push a single commit, or is that not necessary?

Contributor

wimglenn commented Aug 22, 2018

@RonnyPfannschmidt Think that whacked 'em all for the moment. How is the workflow in pytest-dev, should I rebase and squash/force push a single commit, or is that not necessary?

@nicoddemus

This comment has been minimized.

Show comment
Hide comment
@nicoddemus

nicoddemus Aug 23, 2018

Member

@RonnyPfannschmidt Think that whacked 'em all for the moment. How is the workflow in pytest-dev, should I rebase and squash/force push a single commit, or is that not necessary?

Usually we don't rebase/squash commits, unless when changing the target branch (master -> features for example).

Member

nicoddemus commented Aug 23, 2018

@RonnyPfannschmidt Think that whacked 'em all for the moment. How is the workflow in pytest-dev, should I rebase and squash/force push a single commit, or is that not necessary?

Usually we don't rebase/squash commits, unless when changing the target branch (master -> features for example).

@wimglenn wimglenn merged commit d54aa8c into pytest-dev:master Aug 23, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wimglenn wimglenn deleted the wimglenn:pytester_unicode_bugfixes branch Aug 23, 2018

wimglenn added a commit to wimglenn/pytest-custom-report that referenced this pull request Aug 28, 2018

wimglenn added a commit to wimglenn/pytest-custom-report that referenced this pull request Aug 28, 2018

cmccandless added a commit to cmccandless/multisite that referenced this pull request Aug 30, 2018

Update pytest to 3.7.4 (#10)
This PR updates [pytest](https://pypi.org/project/pytest) from **3.7.2** to **3.7.4**.



<details>
  <summary>Changelog</summary>
  
  
   ### 3.7.4
   ```
   =========================

Bug Fixes
---------

- `3506 &lt;https://github.com/pytest-dev/pytest/issues/3506&gt;`_: Fix possible infinite recursion when writing ``.pyc`` files.


- `3853 &lt;https://github.com/pytest-dev/pytest/issues/3853&gt;`_: Cache plugin now obeys the ``-q`` flag when ``--last-failed`` and ``--failed-first`` flags are used.


- `3883 &lt;https://github.com/pytest-dev/pytest/issues/3883&gt;`_: Fix bad console output when using ``console_output_style=classic``.


- `3888 &lt;https://github.com/pytest-dev/pytest/issues/3888&gt;`_: Fix macOS specific code using ``capturemanager`` plugin in doctests.



Improved Documentation
----------------------

- `3902 &lt;https://github.com/pytest-dev/pytest/issues/3902&gt;`_: Fix pytest.org links
   ```
   
  
  
   ### 3.7.3
   ```
   =========================

Bug Fixes
---------

- `3033 &lt;https://github.com/pytest-dev/pytest/issues/3033&gt;`_: Fixtures during teardown can again use ``capsys`` and ``capfd`` to inspect output captured during tests.


- `3773 &lt;https://github.com/pytest-dev/pytest/issues/3773&gt;`_: Fix collection of tests from ``__init__.py`` files if they match the ``python_files`` configuration option.


- `3796 &lt;https://github.com/pytest-dev/pytest/issues/3796&gt;`_: Fix issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer
  package.


- `3816 &lt;https://github.com/pytest-dev/pytest/issues/3816&gt;`_: Fix bug where ``--show-capture=no`` option would still show logs printed during fixture teardown.


- `3819 &lt;https://github.com/pytest-dev/pytest/issues/3819&gt;`_: Fix ``stdout/stderr`` not getting captured when real-time cli logging is active.


- `3843 &lt;https://github.com/pytest-dev/pytest/issues/3843&gt;`_: Fix collection error when specifying test functions directly in the command line using ``test.py::test`` syntax together with ``--doctest-modules``.


- `3848 &lt;https://github.com/pytest-dev/pytest/issues/3848&gt;`_: Fix bugs where unicode arguments could not be passed to ``testdir.runpytest`` on Python 2.


- `3854 &lt;https://github.com/pytest-dev/pytest/issues/3854&gt;`_: Fix double collection of tests within packages when the filename starts with a capital letter.



Improved Documentation
----------------------

- `3824 &lt;https://github.com/pytest-dev/pytest/issues/3824&gt;`_: Added example for multiple glob pattern matches in ``python_files``.


- `3833 &lt;https://github.com/pytest-dev/pytest/issues/3833&gt;`_: Added missing docs for ``pytester.Testdir``.


- `3870 &lt;https://github.com/pytest-dev/pytest/issues/3870&gt;`_: Correct documentation for setuptools integration.



Trivial/Internal Changes
------------------------

- `3826 &lt;https://github.com/pytest-dev/pytest/issues/3826&gt;`_: Replace broken type annotations with type comments.


- `3845 &lt;https://github.com/pytest-dev/pytest/issues/3845&gt;`_: Remove a reference to issue `568 &lt;https://github.com/pytest-dev/pytest/issues/568&gt;`_ from the documentation, which has since been
  fixed.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment