typogrify icon indicating copy to clipboard operation
typogrify copied to clipboard

pytest warnings

Open kloczek opened this issue 3 years ago • 6 comments

Looks like typogrify is not fullly pytest 4.0 ready. Just normal build, install and test cycle:

  • "setup.py build":
  • "setupy install --root </install/prefix>"
  • "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix>
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-typogrify-2.0.7-11.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-typogrify-2.0.7-11.fc35.x86_64/usr/lib/python3.8/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ /usr/bin/pytest -ra --doctest-modules typogrify/filters.py typogrify/packages/titlecase/tests.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/typogrify-2.0.7
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1
collected 12 items

typogrify/filters.py .......                                                                                                                                         [ 58%]
typogrify/packages/titlecase/tests.py ....x                                                                                                                          [100%]

============================================================================= warnings summary =============================================================================
typogrify/filters.py:46
  /home/tkloczko/rpmbuild/BUILD/typogrify-2.0.7/typogrify/filters.py:46: DeprecationWarning: invalid escape sequence \s
    tag = match.group(1) if match.group(1) != '' else '[^\s.#<>]+'

typogrify/filters.py:140
  /home/tkloczko/rpmbuild/BUILD/typogrify-2.0.7/typogrify/filters.py:140: DeprecationWarning: invalid escape sequence \w
    tag_pattern = '</?\w+((\s+\w+(\s*=\s*(?:".*?"|\'.*?\'|[^\'">\s]+))?)+\s*|\s*)/?>'

typogrify/packages/titlecase/__init__.py:17
  /home/tkloczko/rpmbuild/BUILD/typogrify-2.0.7/typogrify/packages/titlecase/__init__.py:17: DeprecationWarning: invalid escape sequence \.
    SMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\.?|via|vs\.?'

typogrify/packages/titlecase/__init__.py:17
  /home/tkloczko/rpmbuild/BUILD/typogrify-2.0.7/typogrify/packages/titlecase/../titlecase/__init__.py:17: DeprecationWarning: invalid escape sequence \.
    SMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\.?|via|vs\.?'

typogrify/packages/titlecase/tests.py:164
  typogrify/packages/titlecase/tests.py:164: PytestCollectionWarning: yield tests were removed in pytest 4.0 - test_input_output will be ignored
    def test_input_output():

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
XFAIL typogrify/packages/titlecase/tests.py::test_input_output
  reason: [NOTRUN] yield tests were removed in pytest 4.0 - test_input_output will be ignored
================================================================ 11 passed, 1 xfailed, 5 warnings in 0.35s =================================================================

BTW: do you have any plans to make new release?

kloczek avatar Jun 12 '21 12:06 kloczek

Hi Tomasz. I think the concept of a "normal build, install, and test cycle" is mutable, and in this case the steps for setting up a Typogrify development environment (including how to run the tests) are clearly proscribed in the README. When following those steps, I cannot replicate the problem described here.

As far as issuing a new release, nearly all the recent changes relate to tooling/infrastructure and don't impact Typogrify's behavior. That said, I will do my best to issue a new release as soon as I can.

justinmayer avatar Jun 12 '21 12:06 justinmayer

I'm not developing any module. I'm packaging that kinsd of resourses so fom that point of view it is indeed when such process needs to be executed from non-root account but in final form needs to be installed in python tree.

Whatever is in that file has nothing to do with those pytest warnings.

kloczek avatar Jun 12 '21 13:06 kloczek

Just in case .. in top part of the pytest output you have all necessary details of the build env. If something is missing please let me lkow I'll be glad to provide all necessary details.

kloczek avatar Jun 12 '21 13:06 kloczek

Be that as it may, the tests pass just fine for me via this project's canonical instructions, and I don't have time to dig into this issue any further. Would you propose a pull request to address what you perceive as areas in need of improvement?

justinmayer avatar Jun 12 '21 13:06 justinmayer

Be that as it may, the tests pass just fine for me via this project's canonical instructions, and I don't have time to dig into this issue any further. Would you propose a pull request to address what you perceive as areas in need of improvement?

I fully understand that. I fully understand as well that if I'll run pytest in exactly the same set of modules I would be not able to see probably of those warnings.

Just please have look one more time on that output to see list of pytest extensions used by pytest in that test. Some of those extensions are about performing code scanning and other sanity checks. So instead bouncing me back to your procedure please have look on that output as as you know you code the best jus please asses is it here anything which may closer look or not. I cannot provide PR. I'm only messenger and I'm only showing you what I see in devel env where I have now installed +450 python modules (all up-to-date) in which not to many people on this planet usually is running your code. If you are not interested results of running in such env please let me know and I promise I will never bother you results of such tests. If you are thinking that is is nothing to do/investigate here just please close that ticket.

If you have no time now maybe later .. no rush. This is just a warning and probably it is nothing critical.

kloczek avatar Jun 12 '21 13:06 kloczek

Any update about his issue? 😃

kloczek avatar Apr 11 '22 01:04 kloczek