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

0.3.12: pytest is failing #54

Closed
kloczek opened this issue Jul 30, 2021 · 3 comments
Closed

0.3.12: pytest is failing #54

kloczek opened this issue Jul 30, 2021 · 3 comments

Comments

@kloczek
Copy link

kloczek commented Jul 30, 2021

Just normal build, install and test cycle used on building package from non-root account:

  • "setup.py build"
  • "setup.py install --root </install/prefix>"
  • "pytest with PYTHONPATH pointing to setearch and sitelib inside </install/prefix>
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-black-0.3.12-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-black-0.3.12-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, 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)
Using --randomly-seed=3387014333
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-black-0.3.12
plugins: black-0.3.12, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, 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, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, hypothesis-6.14.4, Faker-8.10.3, xprocess-0.18.1, randomly-3.8.0
collected 10 items

tests/test_black.py F.FF.                                                                                                                                            [ 50%]
. .                                                                                                                                                                  [ 60%]
tests/test_black.py ...                                                                                                                                              [ 90%]
tests/test_no_black.py s                                                                                                                                             [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ test_exclude _______________________________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-9/test_exclude0')>

    def test_exclude(testdir):
        """Assert test is skipped if path is excluded even if also included
        """
>       testdir.makefile(
            "pyproject.toml",
            """
            [tool.black]
                include = 'test_exclude.py'
                exclude = '.*'
        """,
        )

/home/tkloczko/rpmbuild/BUILD/pytest-black-0.3.12/tests/test_black.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/_pytest/pytester.py:1547: in makefile
    return py.path.local(str(self._pytester.makefile(ext, *args, **kwargs)))
/usr/lib/python3.8/site-packages/_pytest/pytester.py:788: in makefile
    return self._makefile(ext, args, kwargs)
/usr/lib/python3.8/site-packages/_pytest/pytester.py:756: in _makefile
    p = self.path.joinpath(basename).with_suffix(ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = PosixPath('/tmp/pytest-of-tkloczko/pytest-9/test_exclude0/test_exclude'), suffix = 'pyproject.toml'

    def with_suffix(self, suffix):
        """Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        """
        f = self._flavour
        if f.sep in suffix or f.altsep and f.altsep in suffix:
            raise ValueError("Invalid suffix %r" % (suffix,))
        if suffix and not suffix.startswith('.') or suffix == '.':
>           raise ValueError("Invalid suffix %r" % (suffix))
E           ValueError: Invalid suffix 'pyproject.toml'

/usr/lib64/python3.8/pathlib.py:869: ValueError
___________________________________________________________________________ test_exclude_folder ____________________________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-9/test_exclude_folder0')>

    def test_exclude_folder(testdir):
        """Assert test is skipped for files in a folder
        """
>       testdir.makefile(
            "pyproject.toml",
            """
            [tool.black]
                exclude = '''
                (
                  /(
                      first_folder
                    | ignore_folder
                  )/
                )
        '''
        """,
        )

/home/tkloczko/rpmbuild/BUILD/pytest-black-0.3.12/tests/test_black.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/_pytest/pytester.py:1547: in makefile
    return py.path.local(str(self._pytester.makefile(ext, *args, **kwargs)))
/usr/lib/python3.8/site-packages/_pytest/pytester.py:788: in makefile
    return self._makefile(ext, args, kwargs)
/usr/lib/python3.8/site-packages/_pytest/pytester.py:756: in _makefile
    p = self.path.joinpath(basename).with_suffix(ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = PosixPath('/tmp/pytest-of-tkloczko/pytest-9/test_exclude_folder0/test_exclude_folder'), suffix = 'pyproject.toml'

    def with_suffix(self, suffix):
        """Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        """
        f = self._flavour
        if f.sep in suffix or f.altsep and f.altsep in suffix:
            raise ValueError("Invalid suffix %r" % (suffix,))
        if suffix and not suffix.startswith('.') or suffix == '.':
>           raise ValueError("Invalid suffix %r" % (suffix))
E           ValueError: Invalid suffix 'pyproject.toml'

/usr/lib64/python3.8/pathlib.py:869: ValueError
_______________________________________________________________________________ test_include _______________________________________________________________________________

testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-9/test_include0')>

    def test_include(testdir):
        """Assert test is not skipped if path is included but not excluded
        """
>       testdir.makefile(
            "pyproject.toml",
            """
            [tool.black]
                include = 'test_include'
        """,
        )

/home/tkloczko/rpmbuild/BUILD/pytest-black-0.3.12/tests/test_black.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/_pytest/pytester.py:1547: in makefile
    return py.path.local(str(self._pytester.makefile(ext, *args, **kwargs)))
/usr/lib/python3.8/site-packages/_pytest/pytester.py:788: in makefile
    return self._makefile(ext, args, kwargs)
/usr/lib/python3.8/site-packages/_pytest/pytester.py:756: in _makefile
    p = self.path.joinpath(basename).with_suffix(ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = PosixPath('/tmp/pytest-of-tkloczko/pytest-9/test_include0/test_include'), suffix = 'pyproject.toml'

    def with_suffix(self, suffix):
        """Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        """
        f = self._flavour
        if f.sep in suffix or f.altsep and f.altsep in suffix:
            raise ValueError("Invalid suffix %r" % (suffix,))
        if suffix and not suffix.startswith('.') or suffix == '.':
>           raise ValueError("Invalid suffix %r" % (suffix))
E           ValueError: Invalid suffix 'pyproject.toml'

/usr/lib64/python3.8/pathlib.py:869: ValueError
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/conftest.py:18: Black is available
FAILED tests/test_black.py::test_exclude - ValueError: Invalid suffix 'pyproject.toml'
FAILED tests/test_black.py::test_exclude_folder - ValueError: Invalid suffix 'pyproject.toml'
FAILED tests/test_black.py::test_include - ValueError: Invalid suffix 'pyproject.toml'
================================================================= 3 failed, 6 passed, 1 skipped in 11.21s ==================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
@kloczek
Copy link
Author

kloczek commented Apr 9, 2022

ping .. 😄

@rbebb
Copy link

rbebb commented Jul 15, 2022

@kloczek Since this ticket already exists, let's close the more recent one!: #58 (comment)

@kloczek
Copy link
Author

kloczek commented Jul 16, 2022

OK. Closing 👍

@kloczek kloczek closed this as completed Jul 16, 2022
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

No branches or pull requests

2 participants